This is page 170 of 182. Use http://codebase.md/xmlui-org/xmlui/tools/vscode/resources/%7B$item.flickr_images[0]%7D?lines=true&page={x} to view the full context.
# Directory Structure
```
├── .changeset
│ └── config.json
├── .eslintrc.cjs
├── .github
│ ├── build-checklist.png
│ ├── ISSUE_TEMPLATE
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ └── workflows
│ ├── deploy-blog-optimized.yml
│ ├── deploy-blog.yml
│ ├── deploy-docs-optimized.yml
│ ├── deploy-docs.yml
│ ├── prepare-versions.yml
│ ├── release-packages.yml
│ ├── run-all-tests.yml
│ └── run-smoke-tests.yml
├── .gitignore
├── .prettierrc.js
├── .vscode
│ ├── launch.json
│ └── settings.json
├── blog
│ ├── .gitignore
│ ├── .gitkeep
│ ├── CHANGELOG.md
│ ├── extensions.ts
│ ├── index.html
│ ├── index.ts
│ ├── package.json
│ ├── public
│ │ ├── blog
│ │ │ ├── images
│ │ │ │ ├── an-advanced-codefence.gif
│ │ │ │ ├── an-advanced-codefence.mp4
│ │ │ │ ├── blog-page-component.png
│ │ │ │ ├── blog-scrabble.png
│ │ │ │ ├── codefence-runner.png
│ │ │ │ ├── integrated-blog-search.png
│ │ │ │ ├── lorem-ipsum.png
│ │ │ │ ├── playground-checkbox-source.png
│ │ │ │ ├── playground.png
│ │ │ │ ├── use-xmlui-mcp-to-find-a-howto.png
│ │ │ │ └── xmlui-demo-gallery.png
│ │ │ ├── introducing-xmlui.md
│ │ │ ├── lorem-ipsum.md
│ │ │ ├── newest-post.md
│ │ │ ├── older-post.md
│ │ │ ├── xmlui-playground.md
│ │ │ └── xmlui-powered-blog.md
│ │ ├── mockServiceWorker.js
│ │ ├── resources
│ │ │ ├── favicon.ico
│ │ │ ├── files
│ │ │ │ └── for-download
│ │ │ │ └── xmlui
│ │ │ │ └── xmlui-standalone.umd.js
│ │ │ ├── github.svg
│ │ │ ├── llms.txt
│ │ │ ├── logo-dark.svg
│ │ │ ├── logo.svg
│ │ │ ├── pg-popout.svg
│ │ │ ├── rss.svg
│ │ │ └── xmlui-logo.svg
│ │ ├── serve.json
│ │ └── web.config
│ ├── scripts
│ │ ├── download-latest-xmlui.js
│ │ ├── generate-rss.js
│ │ ├── get-releases.js
│ │ └── utils.js
│ ├── src
│ │ ├── components
│ │ │ ├── BlogOverview.xmlui
│ │ │ ├── BlogPage.xmlui
│ │ │ └── PageNotFound.xmlui
│ │ ├── config.ts
│ │ ├── Main.xmlui
│ │ └── themes
│ │ └── blog-theme.ts
│ └── tsconfig.json
├── CONTRIBUTING.md
├── docs
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── ComponentRefLinks.txt
│ ├── content
│ │ ├── _meta.json
│ │ ├── components
│ │ │ ├── _meta.json
│ │ │ ├── _overview.md
│ │ │ ├── APICall.md
│ │ │ ├── App.md
│ │ │ ├── AppHeader.md
│ │ │ ├── AppState.md
│ │ │ ├── AutoComplete.md
│ │ │ ├── Avatar.md
│ │ │ ├── Backdrop.md
│ │ │ ├── Badge.md
│ │ │ ├── BarChart.md
│ │ │ ├── Bookmark.md
│ │ │ ├── Breakout.md
│ │ │ ├── Button.md
│ │ │ ├── Card.md
│ │ │ ├── Carousel.md
│ │ │ ├── ChangeListener.md
│ │ │ ├── Checkbox.md
│ │ │ ├── CHStack.md
│ │ │ ├── ColorPicker.md
│ │ │ ├── Column.md
│ │ │ ├── ContentSeparator.md
│ │ │ ├── CVStack.md
│ │ │ ├── DataSource.md
│ │ │ ├── DateInput.md
│ │ │ ├── DatePicker.md
│ │ │ ├── DonutChart.md
│ │ │ ├── DropdownMenu.md
│ │ │ ├── EmojiSelector.md
│ │ │ ├── ExpandableItem.md
│ │ │ ├── FileInput.md
│ │ │ ├── FileUploadDropZone.md
│ │ │ ├── FlowLayout.md
│ │ │ ├── Footer.md
│ │ │ ├── Form.md
│ │ │ ├── FormItem.md
│ │ │ ├── FormSection.md
│ │ │ ├── Fragment.md
│ │ │ ├── H1.md
│ │ │ ├── H2.md
│ │ │ ├── H3.md
│ │ │ ├── H4.md
│ │ │ ├── H5.md
│ │ │ ├── H6.md
│ │ │ ├── Heading.md
│ │ │ ├── HSplitter.md
│ │ │ ├── HStack.md
│ │ │ ├── Icon.md
│ │ │ ├── IFrame.md
│ │ │ ├── Image.md
│ │ │ ├── Items.md
│ │ │ ├── LabelList.md
│ │ │ ├── Legend.md
│ │ │ ├── LineChart.md
│ │ │ ├── Link.md
│ │ │ ├── List.md
│ │ │ ├── Logo.md
│ │ │ ├── Markdown.md
│ │ │ ├── MenuItem.md
│ │ │ ├── MenuSeparator.md
│ │ │ ├── ModalDialog.md
│ │ │ ├── NavGroup.md
│ │ │ ├── NavLink.md
│ │ │ ├── NavPanel.md
│ │ │ ├── NoResult.md
│ │ │ ├── NumberBox.md
│ │ │ ├── Option.md
│ │ │ ├── Page.md
│ │ │ ├── PageMetaTitle.md
│ │ │ ├── Pages.md
│ │ │ ├── Pagination.md
│ │ │ ├── PasswordInput.md
│ │ │ ├── PieChart.md
│ │ │ ├── ProgressBar.md
│ │ │ ├── Queue.md
│ │ │ ├── RadioGroup.md
│ │ │ ├── RealTimeAdapter.md
│ │ │ ├── Redirect.md
│ │ │ ├── Select.md
│ │ │ ├── Slider.md
│ │ │ ├── Slot.md
│ │ │ ├── SpaceFiller.md
│ │ │ ├── Spinner.md
│ │ │ ├── Splitter.md
│ │ │ ├── Stack.md
│ │ │ ├── StickyBox.md
│ │ │ ├── SubMenuItem.md
│ │ │ ├── Switch.md
│ │ │ ├── TabItem.md
│ │ │ ├── Table.md
│ │ │ ├── TableOfContents.md
│ │ │ ├── Tabs.md
│ │ │ ├── Text.md
│ │ │ ├── TextArea.md
│ │ │ ├── TextBox.md
│ │ │ ├── Theme.md
│ │ │ ├── TimeInput.md
│ │ │ ├── Timer.md
│ │ │ ├── ToneChangerButton.md
│ │ │ ├── ToneSwitch.md
│ │ │ ├── Tooltip.md
│ │ │ ├── Tree.md
│ │ │ ├── VSplitter.md
│ │ │ ├── VStack.md
│ │ │ ├── xmlui-animations
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ ├── Animation.md
│ │ │ │ ├── FadeAnimation.md
│ │ │ │ ├── FadeInAnimation.md
│ │ │ │ ├── FadeOutAnimation.md
│ │ │ │ ├── ScaleAnimation.md
│ │ │ │ └── SlideInAnimation.md
│ │ │ ├── xmlui-pdf
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ └── Pdf.md
│ │ │ ├── xmlui-spreadsheet
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ └── Spreadsheet.md
│ │ │ └── xmlui-website-blocks
│ │ │ ├── _meta.json
│ │ │ ├── _overview.md
│ │ │ ├── Carousel.md
│ │ │ ├── HelloMd.md
│ │ │ ├── HeroSection.md
│ │ │ └── ScrollToTop.md
│ │ └── extensions
│ │ ├── _meta.json
│ │ ├── xmlui-animations
│ │ │ ├── _meta.json
│ │ │ ├── _overview.md
│ │ │ ├── Animation.md
│ │ │ ├── FadeAnimation.md
│ │ │ ├── FadeInAnimation.md
│ │ │ ├── FadeOutAnimation.md
│ │ │ ├── ScaleAnimation.md
│ │ │ └── SlideInAnimation.md
│ │ └── xmlui-website-blocks
│ │ ├── _meta.json
│ │ ├── _overview.md
│ │ ├── Carousel.md
│ │ ├── HelloMd.md
│ │ ├── HeroSection.md
│ │ └── ScrollToTop.md
│ ├── extensions.ts
│ ├── index.html
│ ├── index.ts
│ ├── package.json
│ ├── public
│ │ ├── feed.rss
│ │ ├── mockServiceWorker.js
│ │ ├── pages
│ │ │ ├── _meta.json
│ │ │ ├── app-structure.md
│ │ │ ├── build-editor-component.md
│ │ │ ├── build-hello-world-component.md
│ │ │ ├── components-intro.md
│ │ │ ├── context-variables.md
│ │ │ ├── forms.md
│ │ │ ├── globals.md
│ │ │ ├── glossary.md
│ │ │ ├── helper-tags.md
│ │ │ ├── hosted-deployment.md
│ │ │ ├── howto
│ │ │ │ ├── assign-a-complex-json-literal-to-a-component-variable.md
│ │ │ │ ├── chain-a-refetch.md
│ │ │ │ ├── control-cache-invalidation.md
│ │ │ │ ├── debounce-user-input-for-api-calls.md
│ │ │ │ ├── debug-a-component.md
│ │ │ │ ├── delay-a-datasource-until-another-datasource-is-ready.md
│ │ │ │ ├── delegate-a-method.md
│ │ │ │ ├── do-custom-form-validation.md
│ │ │ │ ├── expose-a-method-from-a-component.md
│ │ │ │ ├── filter-and-transform-data-from-an-api.md
│ │ │ │ ├── group-items-in-list-by-a-property.md
│ │ │ │ ├── handle-background-operations.md
│ │ │ │ ├── hide-an-element-until-its-datasource-is-ready.md
│ │ │ │ ├── make-a-set-of-equal-width-cards.md
│ │ │ │ ├── make-a-table-responsive.md
│ │ │ │ ├── make-navpanel-width-responsive.md
│ │ │ │ ├── modify-a-value-reported-in-a-column.md
│ │ │ │ ├── paginate-a-list.md
│ │ │ │ ├── pass-data-to-a-modal-dialog.md
│ │ │ │ ├── react-to-button-click-not-keystrokes.md
│ │ │ │ ├── set-the-initial-value-of-a-select-from-fetched-data.md
│ │ │ │ ├── share-a-modaldialog-across-components.md
│ │ │ │ ├── sync-selections-between-table-and-list-views.md
│ │ │ │ ├── update-ui-optimistically.md
│ │ │ │ ├── use-built-in-form-validation.md
│ │ │ │ └── use-the-same-modaldialog-to-add-or-edit.md
│ │ │ ├── howto.md
│ │ │ ├── intro.md
│ │ │ ├── layout.md
│ │ │ ├── markup.md
│ │ │ ├── mcp.md
│ │ │ ├── modal-dialogs.md
│ │ │ ├── news-and-reviews.md
│ │ │ ├── reactive-intro.md
│ │ │ ├── refactoring.md
│ │ │ ├── routing-and-links.md
│ │ │ ├── samples
│ │ │ │ ├── color-palette.xmlui
│ │ │ │ ├── color-values.xmlui
│ │ │ │ ├── shadow-sizes.xmlui
│ │ │ │ ├── spacing-sizes.xmlui
│ │ │ │ ├── swatch.xmlui
│ │ │ │ ├── theme-gallery-brief.xmlui
│ │ │ │ └── theme-gallery.xmlui
│ │ │ ├── scoping.md
│ │ │ ├── scripting.md
│ │ │ ├── styles-and-themes
│ │ │ │ ├── common-units.md
│ │ │ │ ├── layout-props.md
│ │ │ │ ├── theme-variable-defaults.md
│ │ │ │ ├── theme-variables.md
│ │ │ │ └── themes.md
│ │ │ ├── template-properties.md
│ │ │ ├── test.md
│ │ │ ├── tutorial-01.md
│ │ │ ├── tutorial-02.md
│ │ │ ├── tutorial-03.md
│ │ │ ├── tutorial-04.md
│ │ │ ├── tutorial-05.md
│ │ │ ├── tutorial-06.md
│ │ │ ├── tutorial-07.md
│ │ │ ├── tutorial-08.md
│ │ │ ├── tutorial-09.md
│ │ │ ├── tutorial-10.md
│ │ │ ├── tutorial-11.md
│ │ │ ├── tutorial-12.md
│ │ │ ├── universal-properties.md
│ │ │ ├── user-defined-components.md
│ │ │ ├── vscode.md
│ │ │ ├── working-with-markdown.md
│ │ │ ├── working-with-text.md
│ │ │ ├── xmlui-animations
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ ├── Animation.md
│ │ │ │ ├── FadeAnimation.md
│ │ │ │ ├── FadeInAnimation.md
│ │ │ │ ├── FadeOutAnimation.md
│ │ │ │ ├── ScaleAnimation.md
│ │ │ │ └── SlideInAnimation.md
│ │ │ ├── xmlui-charts
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ ├── BarChart.md
│ │ │ │ ├── DonutChart.md
│ │ │ │ ├── LabelList.md
│ │ │ │ ├── Legend.md
│ │ │ │ ├── LineChart.md
│ │ │ │ └── PieChart.md
│ │ │ ├── xmlui-pdf
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ └── Pdf.md
│ │ │ └── xmlui-spreadsheet
│ │ │ ├── _meta.json
│ │ │ ├── _overview.md
│ │ │ └── Spreadsheet.md
│ │ ├── resources
│ │ │ ├── devdocs
│ │ │ │ ├── debug-proxy-object-2.png
│ │ │ │ ├── debug-proxy-object.png
│ │ │ │ ├── table_editor_01.png
│ │ │ │ ├── table_editor_02.png
│ │ │ │ ├── table_editor_03.png
│ │ │ │ ├── table_editor_04.png
│ │ │ │ ├── table_editor_05.png
│ │ │ │ ├── table_editor_06.png
│ │ │ │ ├── table_editor_07.png
│ │ │ │ ├── table_editor_08.png
│ │ │ │ ├── table_editor_09.png
│ │ │ │ ├── table_editor_10.png
│ │ │ │ ├── table_editor_11.png
│ │ │ │ ├── table-editor-01.png
│ │ │ │ ├── table-editor-02.png
│ │ │ │ ├── table-editor-03.png
│ │ │ │ ├── table-editor-04.png
│ │ │ │ ├── table-editor-06.png
│ │ │ │ ├── table-editor-07.png
│ │ │ │ ├── table-editor-08.png
│ │ │ │ ├── table-editor-09.png
│ │ │ │ └── xmlui-rendering-of-tiptap-markdown.png
│ │ │ ├── favicon.ico
│ │ │ ├── files
│ │ │ │ ├── clients.json
│ │ │ │ ├── daily-revenue.json
│ │ │ │ ├── dashboard-stats.json
│ │ │ │ ├── demo.xmlui
│ │ │ │ ├── demo.xmlui.xs
│ │ │ │ ├── downloads
│ │ │ │ │ └── downloads.json
│ │ │ │ ├── for-download
│ │ │ │ │ ├── index-with-api.html
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── mockApi.js
│ │ │ │ │ ├── start-darwin.sh
│ │ │ │ │ ├── start-linux.sh
│ │ │ │ │ ├── start.bat
│ │ │ │ │ └── xmlui
│ │ │ │ │ └── xmlui-standalone.umd.js
│ │ │ │ ├── getting-started
│ │ │ │ │ ├── cl-tutorial-final.zip
│ │ │ │ │ ├── cl-tutorial.zip
│ │ │ │ │ ├── cl-tutorial2.zip
│ │ │ │ │ ├── cl-tutorial3.zip
│ │ │ │ │ ├── cl-tutorial4.zip
│ │ │ │ │ ├── cl-tutorial5.zip
│ │ │ │ │ ├── cl-tutorial6.zip
│ │ │ │ │ ├── getting-started.zip
│ │ │ │ │ ├── hello-xmlui.zip
│ │ │ │ │ ├── xmlui-empty.zip
│ │ │ │ │ └── xmlui-starter.zip
│ │ │ │ ├── howto
│ │ │ │ │ └── component-icons
│ │ │ │ │ └── up-arrow.svg
│ │ │ │ ├── invoices.json
│ │ │ │ ├── monthly-status.json
│ │ │ │ ├── news-and-reviews.json
│ │ │ │ ├── products.json
│ │ │ │ ├── releases.json
│ │ │ │ ├── tutorials
│ │ │ │ │ ├── datasource
│ │ │ │ │ │ └── api.ts
│ │ │ │ │ └── p2do
│ │ │ │ │ ├── api.ts
│ │ │ │ │ └── todo-logo.svg
│ │ │ │ └── xmlui.json
│ │ │ ├── github.svg
│ │ │ ├── images
│ │ │ │ ├── apiaction-tutorial
│ │ │ │ │ ├── add-success.png
│ │ │ │ │ ├── apiaction-param.png
│ │ │ │ │ ├── change-completed.png
│ │ │ │ │ ├── change-in-progress.png
│ │ │ │ │ ├── confirm-delete.png
│ │ │ │ │ ├── data-error.png
│ │ │ │ │ ├── data-progress.png
│ │ │ │ │ ├── data-success.png
│ │ │ │ │ ├── display-1.png
│ │ │ │ │ ├── item-deleted.png
│ │ │ │ │ ├── item-updated.png
│ │ │ │ │ ├── missing-api-key.png
│ │ │ │ │ ├── new-item-added.png
│ │ │ │ │ └── test-message.png
│ │ │ │ ├── chat-api
│ │ │ │ │ └── domain-model.svg
│ │ │ │ ├── components
│ │ │ │ │ ├── image
│ │ │ │ │ │ └── breakfast.jpg
│ │ │ │ │ ├── markdown
│ │ │ │ │ │ └── colors.png
│ │ │ │ │ └── modal
│ │ │ │ │ ├── deep_link_dialog_1.jpg
│ │ │ │ │ └── deep_link_dialog_2.jpg
│ │ │ │ ├── create-apps
│ │ │ │ │ ├── collapsed-vertical.png
│ │ │ │ │ ├── using-forms-warning-dialog.png
│ │ │ │ │ └── using-forms.png
│ │ │ │ ├── datasource-tutorial
│ │ │ │ │ ├── data-with-header.png
│ │ │ │ │ ├── filtered-data.png
│ │ │ │ │ ├── filtered-items.png
│ │ │ │ │ ├── initial-page-items.png
│ │ │ │ │ ├── list-items.png
│ │ │ │ │ ├── next-page-items.png
│ │ │ │ │ ├── no-data.png
│ │ │ │ │ ├── pagination-1.jpg
│ │ │ │ │ ├── pagination-1.png
│ │ │ │ │ ├── polling-1.png
│ │ │ │ │ ├── refetch-data.png
│ │ │ │ │ ├── slow-loading.png
│ │ │ │ │ ├── test-message.png
│ │ │ │ │ ├── Thumbs.db
│ │ │ │ │ ├── unconventional-data.png
│ │ │ │ │ └── unfiltered-items.png
│ │ │ │ ├── flower.jpg
│ │ │ │ ├── get-started
│ │ │ │ │ ├── add-new-contact.png
│ │ │ │ │ ├── app-modified.png
│ │ │ │ │ ├── app-start.png
│ │ │ │ │ ├── app-with-boxes.png
│ │ │ │ │ ├── app-with-toast.png
│ │ │ │ │ ├── boilerplate-structure.png
│ │ │ │ │ ├── cl-initial.png
│ │ │ │ │ ├── cl-start.png
│ │ │ │ │ ├── contact-counts.png
│ │ │ │ │ ├── contact-dialog-title.png
│ │ │ │ │ ├── contact-dialog.png
│ │ │ │ │ ├── contact-menus.png
│ │ │ │ │ ├── contact-predicates.png
│ │ │ │ │ ├── context-menu.png
│ │ │ │ │ ├── dashboard-numbers.png
│ │ │ │ │ ├── default-contact-list.png
│ │ │ │ │ ├── delete-contact.png
│ │ │ │ │ ├── delete-task.png
│ │ │ │ │ ├── detailed-template.png
│ │ │ │ │ ├── edit-contact-details.png
│ │ │ │ │ ├── edited-contact-saved.png
│ │ │ │ │ ├── empty-sections.png
│ │ │ │ │ ├── filter-completed.png
│ │ │ │ │ ├── fullwidth-desktop.png
│ │ │ │ │ ├── fullwidth-mobile.png
│ │ │ │ │ ├── initial-table.png
│ │ │ │ │ ├── items-and-badges.png
│ │ │ │ │ ├── loading-message.png
│ │ │ │ │ ├── new-contact-button.png
│ │ │ │ │ ├── new-contact-saved.png
│ │ │ │ │ ├── no-empty-sections.png
│ │ │ │ │ ├── personal-todo-initial.png
│ │ │ │ │ ├── piechart.png
│ │ │ │ │ ├── review-today.png
│ │ │ │ │ ├── rudimentary-dashboard.png
│ │ │ │ │ ├── section-collapsed.png
│ │ │ │ │ ├── sectioned-items.png
│ │ │ │ │ ├── sections-ordered.png
│ │ │ │ │ ├── spacex-list-with-links.png
│ │ │ │ │ ├── spacex-list.png
│ │ │ │ │ ├── start-personal-todo-1.png
│ │ │ │ │ ├── submit-new-contact.png
│ │ │ │ │ ├── submit-new-task.png
│ │ │ │ │ ├── syntax-highlighting.png
│ │ │ │ │ ├── table-with-badge.png
│ │ │ │ │ ├── template-with-card.png
│ │ │ │ │ ├── test-emulated-api.png
│ │ │ │ │ ├── Thumbs.db
│ │ │ │ │ ├── todo-logo.png
│ │ │ │ │ └── xmlui-tools.png
│ │ │ │ ├── HelloApp.png
│ │ │ │ ├── HelloApp2.png
│ │ │ │ ├── logos
│ │ │ │ │ ├── xmlui1.svg
│ │ │ │ │ ├── xmlui2.svg
│ │ │ │ │ ├── xmlui3.svg
│ │ │ │ │ ├── xmlui4.svg
│ │ │ │ │ ├── xmlui5.svg
│ │ │ │ │ ├── xmlui6.svg
│ │ │ │ │ └── xmlui7.svg
│ │ │ │ ├── pdf
│ │ │ │ │ └── dummy-pdf.jpg
│ │ │ │ ├── rendering-engine
│ │ │ │ │ ├── AppEngine-flow.svg
│ │ │ │ │ ├── Component.svg
│ │ │ │ │ ├── CompoundComponent.svg
│ │ │ │ │ ├── RootComponent.svg
│ │ │ │ │ └── tree-with-containers.svg
│ │ │ │ ├── reviewers-guide
│ │ │ │ │ ├── AppEngine-flow.svg
│ │ │ │ │ └── incbutton-in-action.png
│ │ │ │ ├── tools
│ │ │ │ │ └── boilerplate-structure.png
│ │ │ │ ├── try.svg
│ │ │ │ ├── tutorial
│ │ │ │ │ ├── app-chat-history.png
│ │ │ │ │ ├── app-content-placeholder.png
│ │ │ │ │ ├── app-header-and-content.png
│ │ │ │ │ ├── app-links-channel-selected.png
│ │ │ │ │ ├── app-links-click.png
│ │ │ │ │ ├── app-navigation.png
│ │ │ │ │ ├── finished-ex01.png
│ │ │ │ │ ├── finished-ex02.png
│ │ │ │ │ ├── hello.png
│ │ │ │ │ ├── splash-screen-advanced.png
│ │ │ │ │ ├── splash-screen-after-click.png
│ │ │ │ │ ├── splash-screen-centered.png
│ │ │ │ │ ├── splash-screen-events.png
│ │ │ │ │ ├── splash-screen-expression.png
│ │ │ │ │ ├── splash-screen-reuse-after.png
│ │ │ │ │ ├── splash-screen-reuse-before.png
│ │ │ │ │ └── splash-screen.png
│ │ │ │ └── tutorial-01.png
│ │ │ ├── llms.txt
│ │ │ ├── logo-dark.svg
│ │ │ ├── logo.svg
│ │ │ ├── pg-popout.svg
│ │ │ └── xmlui-logo.svg
│ │ ├── serve.json
│ │ └── web.config
│ ├── scripts
│ │ ├── download-latest-xmlui.js
│ │ ├── generate-rss.js
│ │ ├── get-releases.js
│ │ └── utils.js
│ ├── src
│ │ ├── components
│ │ │ ├── BlogOverview.xmlui
│ │ │ ├── BlogPage.xmlui
│ │ │ ├── Boxes.xmlui
│ │ │ ├── Breadcrumb.xmlui
│ │ │ ├── ChangeLog.xmlui
│ │ │ ├── ColorPalette.xmlui
│ │ │ ├── DocumentLinks.xmlui
│ │ │ ├── DocumentPage.xmlui
│ │ │ ├── DocumentPageNoTOC.xmlui
│ │ │ ├── Icons.xmlui
│ │ │ ├── IncButton.xmlui
│ │ │ ├── IncButton2.xmlui
│ │ │ ├── NameValue.xmlui
│ │ │ ├── PageNotFound.xmlui
│ │ │ ├── PaletteItem.xmlui
│ │ │ ├── Palettes.xmlui
│ │ │ ├── SectionHeader.xmlui
│ │ │ ├── TBD.xmlui
│ │ │ ├── Test.xmlui
│ │ │ ├── ThemesIntro.xmlui
│ │ │ ├── ThousandThemes.xmlui
│ │ │ ├── TubeStops.xmlui
│ │ │ ├── TubeStops.xmlui.xs
│ │ │ └── TwoColumnCode.xmlui
│ │ ├── config.ts
│ │ ├── Main.xmlui
│ │ └── themes
│ │ ├── docs-theme.ts
│ │ ├── earthtone.ts
│ │ ├── xmlui-gray-on-default.ts
│ │ ├── xmlui-green-on-default.ts
│ │ └── xmlui-orange-on-default.ts
│ └── tsconfig.json
├── LICENSE
├── package-lock.json
├── package.json
├── packages
│ ├── tsconfig.json
│ ├── xmlui-animations
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── Animation.tsx
│ │ ├── AnimationNative.tsx
│ │ ├── FadeAnimation.tsx
│ │ ├── FadeInAnimation.tsx
│ │ ├── FadeOutAnimation.tsx
│ │ ├── index.tsx
│ │ ├── ScaleAnimation.tsx
│ │ └── SlideInAnimation.tsx
│ ├── xmlui-devtools
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── devtools
│ │ │ │ ├── DevTools.tsx
│ │ │ │ ├── DevToolsNative.module.scss
│ │ │ │ ├── DevToolsNative.tsx
│ │ │ │ ├── ModalDialog.module.scss
│ │ │ │ ├── ModalDialog.tsx
│ │ │ │ ├── ModalVisibilityContext.tsx
│ │ │ │ ├── Tooltip.module.scss
│ │ │ │ ├── Tooltip.tsx
│ │ │ │ └── utils.ts
│ │ │ ├── editor
│ │ │ │ └── Editor.tsx
│ │ │ └── index.tsx
│ │ └── vite.config-overrides.ts
│ ├── xmlui-hello-world
│ │ ├── .gitignore
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── HelloWorld.module.scss
│ │ ├── HelloWorld.tsx
│ │ ├── HelloWorldNative.tsx
│ │ └── index.tsx
│ ├── xmlui-os-frames
│ │ ├── .gitignore
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── index.tsx
│ │ ├── IPhoneFrame.module.scss
│ │ ├── IPhoneFrame.tsx
│ │ ├── MacOSAppFrame.module.scss
│ │ ├── MacOSAppFrame.tsx
│ │ ├── WindowsAppFrame.module.scss
│ │ └── WindowsAppFrame.tsx
│ ├── xmlui-pdf
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ ├── components
│ │ │ │ └── Pdf.xmlui
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── index.tsx
│ │ ├── LazyPdfNative.tsx
│ │ ├── Pdf.module.scss
│ │ └── Pdf.tsx
│ ├── xmlui-playground
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── hooks
│ │ │ ├── usePlayground.ts
│ │ │ └── useToast.ts
│ │ ├── index.tsx
│ │ ├── playground
│ │ │ ├── Box.module.scss
│ │ │ ├── Box.tsx
│ │ │ ├── CodeSelector.tsx
│ │ │ ├── ConfirmationDialog.module.scss
│ │ │ ├── ConfirmationDialog.tsx
│ │ │ ├── Editor.tsx
│ │ │ ├── Header.module.scss
│ │ │ ├── Header.tsx
│ │ │ ├── Playground.tsx
│ │ │ ├── PlaygroundContent.module.scss
│ │ │ ├── PlaygroundContent.tsx
│ │ │ ├── PlaygroundNative.module.scss
│ │ │ ├── PlaygroundNative.tsx
│ │ │ ├── Preview.module.scss
│ │ │ ├── Preview.tsx
│ │ │ ├── Select.module.scss
│ │ │ ├── StandalonePlayground.tsx
│ │ │ ├── StandalonePlaygroundNative.module.scss
│ │ │ ├── StandalonePlaygroundNative.tsx
│ │ │ ├── ThemeSwitcher.module.scss
│ │ │ ├── ThemeSwitcher.tsx
│ │ │ ├── ToneSwitcher.tsx
│ │ │ ├── Tooltip.module.scss
│ │ │ ├── Tooltip.tsx
│ │ │ └── utils.ts
│ │ ├── providers
│ │ │ ├── Toast.module.scss
│ │ │ └── ToastProvider.tsx
│ │ ├── state
│ │ │ └── store.ts
│ │ ├── themes
│ │ │ └── theme.ts
│ │ └── utils
│ │ └── helpers.ts
│ ├── xmlui-search
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── index.tsx
│ │ ├── Search.module.scss
│ │ └── Search.tsx
│ ├── xmlui-spreadsheet
│ │ ├── .gitignore
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── index.tsx
│ │ ├── Spreadsheet.tsx
│ │ └── SpreadsheetNative.tsx
│ └── xmlui-website-blocks
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── demo
│ │ ├── components
│ │ │ ├── HeroBackgroundBreakoutPage.xmlui
│ │ │ ├── HeroBackgroundsPage.xmlui
│ │ │ ├── HeroContentsPage.xmlui
│ │ │ ├── HeroTextAlignPage.xmlui
│ │ │ ├── HeroTextPage.xmlui
│ │ │ └── HeroTonesPage.xmlui
│ │ ├── Main.xmlui
│ │ └── themes
│ │ └── default.ts
│ ├── index.html
│ ├── index.ts
│ ├── meta
│ │ └── componentsMetadata.ts
│ ├── package.json
│ ├── public
│ │ └── resources
│ │ ├── building.jpg
│ │ └── xmlui-logo.svg
│ └── src
│ ├── Carousel
│ │ ├── Carousel.module.scss
│ │ ├── Carousel.tsx
│ │ ├── CarouselContext.tsx
│ │ └── CarouselNative.tsx
│ ├── FancyButton
│ │ ├── FancyButton.module.scss
│ │ ├── FancyButton.tsx
│ │ └── FancyButton.xmlui
│ ├── Hello
│ │ ├── Hello.tsx
│ │ ├── Hello.xmlui
│ │ └── Hello.xmlui.xs
│ ├── HeroSection
│ │ ├── HeroSection.module.scss
│ │ ├── HeroSection.spec.ts
│ │ ├── HeroSection.tsx
│ │ └── HeroSectionNative.tsx
│ ├── index.tsx
│ ├── ScrollToTop
│ │ ├── ScrollToTop.module.scss
│ │ ├── ScrollToTop.tsx
│ │ └── ScrollToTopNative.tsx
│ └── vite-env.d.ts
├── playwright.config.ts
├── README.md
├── tools
│ ├── codefence
│ │ └── xmlui-code-fence-docs.md
│ ├── create-app
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── create-app.ts
│ │ ├── helpers
│ │ │ ├── copy.ts
│ │ │ ├── get-pkg-manager.ts
│ │ │ ├── git.ts
│ │ │ ├── install.ts
│ │ │ ├── is-folder-empty.ts
│ │ │ ├── is-writeable.ts
│ │ │ ├── make-dir.ts
│ │ │ └── validate-pkg.ts
│ │ ├── index.ts
│ │ ├── package.json
│ │ ├── templates
│ │ │ ├── default
│ │ │ │ └── ts
│ │ │ │ ├── gitignore
│ │ │ │ ├── index.html
│ │ │ │ ├── index.ts
│ │ │ │ ├── public
│ │ │ │ │ ├── mockServiceWorker.js
│ │ │ │ │ ├── resources
│ │ │ │ │ │ ├── favicon.ico
│ │ │ │ │ │ └── xmlui-logo.svg
│ │ │ │ │ └── serve.json
│ │ │ │ └── src
│ │ │ │ ├── components
│ │ │ │ │ ├── ApiAware.xmlui
│ │ │ │ │ ├── Home.xmlui
│ │ │ │ │ ├── IncButton.xmlui
│ │ │ │ │ └── PagePanel.xmlui
│ │ │ │ ├── config.ts
│ │ │ │ └── Main.xmlui
│ │ │ ├── index.ts
│ │ │ └── types.ts
│ │ └── tsconfig.json
│ ├── create-xmlui-hello-world
│ │ ├── index.js
│ │ └── package.json
│ └── vscode
│ ├── .gitignore
│ ├── .vscode
│ │ ├── launch.json
│ │ └── tasks.json
│ ├── .vscodeignore
│ ├── build.sh
│ ├── CHANGELOG.md
│ ├── esbuild.js
│ ├── eslint.config.mjs
│ ├── formatter-docs.md
│ ├── generate-test-sample.sh
│ ├── LICENSE.md
│ ├── package-lock.json
│ ├── package.json
│ ├── README.md
│ ├── resources
│ │ ├── xmlui-logo.png
│ │ └── xmlui-markup-syntax-highlighting.png
│ ├── src
│ │ ├── extension.ts
│ │ └── server.ts
│ ├── syntaxes
│ │ └── xmlui.tmLanguage.json
│ ├── test-samples
│ │ └── sample.xmlui
│ ├── tsconfig.json
│ └── tsconfig.tsbuildinfo
├── turbo.json
└── xmlui
├── .gitignore
├── bin
│ ├── bootstrap.cjs
│ ├── bootstrap.js
│ ├── build-lib.ts
│ ├── build.ts
│ ├── index.ts
│ ├── preview.ts
│ ├── start.ts
│ ├── vite-xmlui-plugin.ts
│ └── viteConfig.ts
├── CHANGELOG.md
├── conventions
│ ├── component-qa-checklist.md
│ ├── copilot-conventions.md
│ ├── create-xmlui-components.md
│ ├── mermaid.md
│ ├── testing-conventions.md
│ └── xmlui-in-a-nutshell.md
├── dev-docs
│ ├── accessibility.md
│ ├── build-system.md
│ ├── build-xmlui.md
│ ├── component-behaviors.md
│ ├── components-with-options.md
│ ├── containers.md
│ ├── data-operations.md
│ ├── glossary.md
│ ├── index.md
│ ├── next
│ │ ├── component-dev-guide.md
│ │ ├── configuration-management-enhancement-summary.md
│ │ ├── documentation-scripts-refactoring-complete-summary.md
│ │ ├── documentation-scripts-refactoring-plan.md
│ │ ├── duplicate-pattern-extraction-summary.md
│ │ ├── error-handling-standardization-summary.md
│ │ ├── generating-component-reference.md
│ │ ├── index.md
│ │ ├── logging-consistency-implementation-summary.md
│ │ ├── project-build.md
│ │ ├── project-structure.md
│ │ ├── theme-context.md
│ │ ├── tiptap-design-considerations.md
│ │ ├── working-with-code.md
│ │ ├── xmlui-runtime-architecture
│ │ └── xmlui-wcag-accessibility-report.md
│ ├── react-fundamentals.md
│ ├── release-method.md
│ ├── standalone-app.md
│ ├── ud-components.md
│ └── xmlui-repo.md
├── package.json
├── scripts
│ ├── coverage-only.js
│ ├── e2e-test-summary.js
│ ├── generate-docs
│ │ ├── build-downloads-map.mjs
│ │ ├── build-pages-map.mjs
│ │ ├── components-config.json
│ │ ├── configuration-management.mjs
│ │ ├── constants.mjs
│ │ ├── create-theme-files.mjs
│ │ ├── DocsGenerator.mjs
│ │ ├── error-handling.mjs
│ │ ├── extensions-config.json
│ │ ├── folders.mjs
│ │ ├── generate-summary-files.mjs
│ │ ├── get-docs.mjs
│ │ ├── input-handler.mjs
│ │ ├── logger.mjs
│ │ ├── logging-standards.mjs
│ │ ├── MetadataProcessor.mjs
│ │ ├── pattern-utilities.mjs
│ │ └── utils.mjs
│ ├── get-langserver-metadata.js
│ ├── inline-links.mjs
│ └── README-e2e-summary.md
├── src
│ ├── abstractions
│ │ ├── _conventions.md
│ │ ├── ActionDefs.ts
│ │ ├── AppContextDefs.ts
│ │ ├── ComponentDefs.ts
│ │ ├── ContainerDefs.ts
│ │ ├── ExtensionDefs.ts
│ │ ├── FunctionDefs.ts
│ │ ├── RendererDefs.ts
│ │ ├── scripting
│ │ │ ├── BlockScope.ts
│ │ │ ├── Compilation.ts
│ │ │ ├── LogicalThread.ts
│ │ │ ├── LoopScope.ts
│ │ │ ├── modules.ts
│ │ │ ├── ScriptParserError.ts
│ │ │ ├── Token.ts
│ │ │ ├── TryScope.ts
│ │ │ └── TryScopeExp.ts
│ │ └── ThemingDefs.ts
│ ├── components
│ │ ├── _conventions.md
│ │ ├── abstractions.ts
│ │ ├── Accordion
│ │ │ ├── Accordion.md
│ │ │ ├── Accordion.module.scss
│ │ │ ├── Accordion.spec.ts
│ │ │ ├── Accordion.tsx
│ │ │ ├── AccordionContext.tsx
│ │ │ ├── AccordionItem.tsx
│ │ │ ├── AccordionItemNative.tsx
│ │ │ └── AccordionNative.tsx
│ │ ├── Animation
│ │ │ └── AnimationNative.tsx
│ │ ├── APICall
│ │ │ ├── APICall.md
│ │ │ ├── APICall.spec.ts
│ │ │ ├── APICall.tsx
│ │ │ └── APICallNative.tsx
│ │ ├── App
│ │ │ ├── App.md
│ │ │ ├── App.module.scss
│ │ │ ├── App.spec.ts
│ │ │ ├── App.tsx
│ │ │ ├── AppLayoutContext.ts
│ │ │ ├── AppNative.tsx
│ │ │ ├── AppStateContext.ts
│ │ │ ├── doc-resources
│ │ │ │ ├── condensed-sticky.xmlui
│ │ │ │ ├── condensed.xmlui
│ │ │ │ ├── horizontal-sticky.xmlui
│ │ │ │ ├── horizontal.xmlui
│ │ │ │ ├── vertical-full-header.xmlui
│ │ │ │ ├── vertical-sticky.xmlui
│ │ │ │ └── vertical.xmlui
│ │ │ ├── IndexerContext.ts
│ │ │ ├── LinkInfoContext.ts
│ │ │ ├── SearchContext.tsx
│ │ │ ├── Sheet.module.scss
│ │ │ └── Sheet.tsx
│ │ ├── AppHeader
│ │ │ ├── AppHeader.md
│ │ │ ├── AppHeader.module.scss
│ │ │ ├── AppHeader.spec.ts
│ │ │ ├── AppHeader.tsx
│ │ │ └── AppHeaderNative.tsx
│ │ ├── AppState
│ │ │ ├── AppState.md
│ │ │ ├── AppState.spec.ts
│ │ │ ├── AppState.tsx
│ │ │ └── AppStateNative.tsx
│ │ ├── AutoComplete
│ │ │ ├── AutoComplete.md
│ │ │ ├── AutoComplete.module.scss
│ │ │ ├── AutoComplete.spec.ts
│ │ │ ├── AutoComplete.tsx
│ │ │ ├── AutoCompleteContext.tsx
│ │ │ └── AutoCompleteNative.tsx
│ │ ├── Avatar
│ │ │ ├── Avatar.md
│ │ │ ├── Avatar.module.scss
│ │ │ ├── Avatar.spec.ts
│ │ │ ├── Avatar.tsx
│ │ │ └── AvatarNative.tsx
│ │ ├── Backdrop
│ │ │ ├── Backdrop.md
│ │ │ ├── Backdrop.module.scss
│ │ │ ├── Backdrop.spec.ts
│ │ │ ├── Backdrop.tsx
│ │ │ └── BackdropNative.tsx
│ │ ├── Badge
│ │ │ ├── Badge.md
│ │ │ ├── Badge.module.scss
│ │ │ ├── Badge.spec.ts
│ │ │ ├── Badge.tsx
│ │ │ └── BadgeNative.tsx
│ │ ├── Bookmark
│ │ │ ├── Bookmark.md
│ │ │ ├── Bookmark.module.scss
│ │ │ ├── Bookmark.spec.ts
│ │ │ ├── Bookmark.tsx
│ │ │ └── BookmarkNative.tsx
│ │ ├── Breakout
│ │ │ ├── Breakout.module.scss
│ │ │ ├── Breakout.spec.ts
│ │ │ ├── Breakout.tsx
│ │ │ └── BreakoutNative.tsx
│ │ ├── Button
│ │ │ ├── Button-style.spec.ts
│ │ │ ├── Button.md
│ │ │ ├── Button.module.scss
│ │ │ ├── Button.spec.ts
│ │ │ ├── Button.tsx
│ │ │ └── ButtonNative.tsx
│ │ ├── Card
│ │ │ ├── Card.md
│ │ │ ├── Card.module.scss
│ │ │ ├── Card.spec.ts
│ │ │ ├── Card.tsx
│ │ │ └── CardNative.tsx
│ │ ├── Carousel
│ │ │ ├── Carousel.md
│ │ │ ├── Carousel.module.scss
│ │ │ ├── Carousel.spec.ts
│ │ │ ├── Carousel.tsx
│ │ │ ├── CarouselContext.tsx
│ │ │ ├── CarouselItem.tsx
│ │ │ ├── CarouselItemNative.tsx
│ │ │ └── CarouselNative.tsx
│ │ ├── ChangeListener
│ │ │ ├── ChangeListener.md
│ │ │ ├── ChangeListener.spec.ts
│ │ │ ├── ChangeListener.tsx
│ │ │ └── ChangeListenerNative.tsx
│ │ ├── chart-color-schemes.ts
│ │ ├── Charts
│ │ │ ├── AreaChart
│ │ │ │ ├── AreaChart.md
│ │ │ │ ├── AreaChart.spec.ts
│ │ │ │ ├── AreaChart.tsx
│ │ │ │ └── AreaChartNative.tsx
│ │ │ ├── BarChart
│ │ │ │ ├── BarChart.md
│ │ │ │ ├── BarChart.module.scss
│ │ │ │ ├── BarChart.spec.ts
│ │ │ │ ├── BarChart.tsx
│ │ │ │ └── BarChartNative.tsx
│ │ │ ├── DonutChart
│ │ │ │ ├── DonutChart.spec.ts
│ │ │ │ └── DonutChart.tsx
│ │ │ ├── LabelList
│ │ │ │ ├── LabelList.spec.ts
│ │ │ │ ├── LabelList.tsx
│ │ │ │ ├── LabelListNative.module.scss
│ │ │ │ └── LabelListNative.tsx
│ │ │ ├── Legend
│ │ │ │ ├── Legend.spec.ts
│ │ │ │ ├── Legend.tsx
│ │ │ │ └── LegendNative.tsx
│ │ │ ├── LineChart
│ │ │ │ ├── LineChart.md
│ │ │ │ ├── LineChart.module.scss
│ │ │ │ ├── LineChart.spec.ts
│ │ │ │ ├── LineChart.tsx
│ │ │ │ └── LineChartNative.tsx
│ │ │ ├── PieChart
│ │ │ │ ├── PieChart.md
│ │ │ │ ├── PieChart.spec.ts
│ │ │ │ ├── PieChart.tsx
│ │ │ │ ├── PieChartNative.module.scss
│ │ │ │ └── PieChartNative.tsx
│ │ │ ├── RadarChart
│ │ │ │ ├── RadarChart.md
│ │ │ │ ├── RadarChart.spec.ts
│ │ │ │ ├── RadarChart.tsx
│ │ │ │ └── RadarChartNative.tsx
│ │ │ ├── Tooltip
│ │ │ │ ├── TooltipContent.module.scss
│ │ │ │ ├── TooltipContent.spec.ts
│ │ │ │ └── TooltipContent.tsx
│ │ │ └── utils
│ │ │ ├── abstractions.ts
│ │ │ └── ChartProvider.tsx
│ │ ├── Checkbox
│ │ │ ├── Checkbox.md
│ │ │ ├── Checkbox.spec.ts
│ │ │ └── Checkbox.tsx
│ │ ├── CodeBlock
│ │ │ ├── CodeBlock.module.scss
│ │ │ ├── CodeBlock.spec.ts
│ │ │ ├── CodeBlock.tsx
│ │ │ ├── CodeBlockNative.tsx
│ │ │ └── highlight-code.ts
│ │ ├── collectedComponentMetadata.ts
│ │ ├── ColorPicker
│ │ │ ├── ColorPicker.md
│ │ │ ├── ColorPicker.module.scss
│ │ │ ├── ColorPicker.spec.ts
│ │ │ ├── ColorPicker.tsx
│ │ │ └── ColorPickerNative.tsx
│ │ ├── Column
│ │ │ ├── Column.md
│ │ │ ├── Column.tsx
│ │ │ ├── ColumnNative.tsx
│ │ │ ├── doc-resources
│ │ │ │ └── list-component-data.js
│ │ │ └── TableContext.tsx
│ │ ├── component-utils.ts
│ │ ├── ComponentProvider.tsx
│ │ ├── ComponentRegistryContext.tsx
│ │ ├── container-helpers.tsx
│ │ ├── ContentSeparator
│ │ │ ├── ContentSeparator.md
│ │ │ ├── ContentSeparator.module.scss
│ │ │ ├── ContentSeparator.spec.ts
│ │ │ ├── ContentSeparator.tsx
│ │ │ └── ContentSeparatorNative.tsx
│ │ ├── DataSource
│ │ │ ├── DataSource.md
│ │ │ └── DataSource.tsx
│ │ ├── DateInput
│ │ │ ├── DateInput.md
│ │ │ ├── DateInput.module.scss
│ │ │ ├── DateInput.spec.ts
│ │ │ ├── DateInput.tsx
│ │ │ └── DateInputNative.tsx
│ │ ├── DatePicker
│ │ │ ├── DatePicker.md
│ │ │ ├── DatePicker.module.scss
│ │ │ ├── DatePicker.spec.ts
│ │ │ ├── DatePicker.tsx
│ │ │ └── DatePickerNative.tsx
│ │ ├── DropdownMenu
│ │ │ ├── DropdownMenu.md
│ │ │ ├── DropdownMenu.module.scss
│ │ │ ├── DropdownMenu.spec.ts
│ │ │ ├── DropdownMenu.tsx
│ │ │ ├── DropdownMenuNative.tsx
│ │ │ ├── MenuItem.md
│ │ │ └── SubMenuItem.md
│ │ ├── EmojiSelector
│ │ │ ├── EmojiSelector.md
│ │ │ ├── EmojiSelector.spec.ts
│ │ │ ├── EmojiSelector.tsx
│ │ │ └── EmojiSelectorNative.tsx
│ │ ├── ExpandableItem
│ │ │ ├── ExpandableItem.module.scss
│ │ │ ├── ExpandableItem.spec.ts
│ │ │ ├── ExpandableItem.tsx
│ │ │ └── ExpandableItemNative.tsx
│ │ ├── FileInput
│ │ │ ├── FileInput.md
│ │ │ ├── FileInput.module.scss
│ │ │ ├── FileInput.spec.ts
│ │ │ ├── FileInput.tsx
│ │ │ └── FileInputNative.tsx
│ │ ├── FileUploadDropZone
│ │ │ ├── FileUploadDropZone.md
│ │ │ ├── FileUploadDropZone.module.scss
│ │ │ ├── FileUploadDropZone.spec.ts
│ │ │ ├── FileUploadDropZone.tsx
│ │ │ └── FileUploadDropZoneNative.tsx
│ │ ├── FlowLayout
│ │ │ ├── FlowLayout.md
│ │ │ ├── FlowLayout.module.scss
│ │ │ ├── FlowLayout.spec.ts
│ │ │ ├── FlowLayout.spec.ts-snapshots
│ │ │ │ └── Edge-cases-boxShadow-is-not-clipped-1-non-smoke-darwin.png
│ │ │ ├── FlowLayout.tsx
│ │ │ └── FlowLayoutNative.tsx
│ │ ├── Footer
│ │ │ ├── Footer.md
│ │ │ ├── Footer.module.scss
│ │ │ ├── Footer.spec.ts
│ │ │ ├── Footer.tsx
│ │ │ └── FooterNative.tsx
│ │ ├── Form
│ │ │ ├── Form.md
│ │ │ ├── Form.module.scss
│ │ │ ├── Form.spec.ts
│ │ │ ├── Form.tsx
│ │ │ ├── formActions.ts
│ │ │ ├── FormContext.ts
│ │ │ └── FormNative.tsx
│ │ ├── FormItem
│ │ │ ├── FormItem.md
│ │ │ ├── FormItem.module.scss
│ │ │ ├── FormItem.spec.ts
│ │ │ ├── FormItem.tsx
│ │ │ ├── FormItemNative.tsx
│ │ │ ├── HelperText.module.scss
│ │ │ ├── HelperText.tsx
│ │ │ ├── ItemWithLabel.tsx
│ │ │ └── Validations.ts
│ │ ├── FormSection
│ │ │ ├── FormSection.md
│ │ │ ├── FormSection.ts
│ │ │ └── FormSection.xmlui
│ │ ├── Fragment
│ │ │ ├── Fragment.spec.ts
│ │ │ └── Fragment.tsx
│ │ ├── Heading
│ │ │ ├── abstractions.ts
│ │ │ ├── H1.md
│ │ │ ├── H1.spec.ts
│ │ │ ├── H2.md
│ │ │ ├── H2.spec.ts
│ │ │ ├── H3.md
│ │ │ ├── H3.spec.ts
│ │ │ ├── H4.md
│ │ │ ├── H4.spec.ts
│ │ │ ├── H5.md
│ │ │ ├── H5.spec.ts
│ │ │ ├── H6.md
│ │ │ ├── H6.spec.ts
│ │ │ ├── Heading.md
│ │ │ ├── Heading.module.scss
│ │ │ ├── Heading.spec.ts
│ │ │ ├── Heading.tsx
│ │ │ └── HeadingNative.tsx
│ │ ├── HoverCard
│ │ │ ├── HoverCard.tsx
│ │ │ └── HovercardNative.tsx
│ │ ├── HtmlTags
│ │ │ ├── HtmlTags.module.scss
│ │ │ ├── HtmlTags.spec.ts
│ │ │ └── HtmlTags.tsx
│ │ ├── Icon
│ │ │ ├── AdmonitionDanger.tsx
│ │ │ ├── AdmonitionInfo.tsx
│ │ │ ├── AdmonitionNote.tsx
│ │ │ ├── AdmonitionTip.tsx
│ │ │ ├── AdmonitionWarning.tsx
│ │ │ ├── ApiIcon.tsx
│ │ │ ├── ArrowDropDown.module.scss
│ │ │ ├── ArrowDropDown.tsx
│ │ │ ├── ArrowDropUp.module.scss
│ │ │ ├── ArrowDropUp.tsx
│ │ │ ├── ArrowLeft.module.scss
│ │ │ ├── ArrowLeft.tsx
│ │ │ ├── ArrowRight.module.scss
│ │ │ ├── ArrowRight.tsx
│ │ │ ├── Attach.tsx
│ │ │ ├── Binding.module.scss
│ │ │ ├── Binding.tsx
│ │ │ ├── BoardIcon.tsx
│ │ │ ├── BoxIcon.tsx
│ │ │ ├── CheckIcon.tsx
│ │ │ ├── ChevronDownIcon.tsx
│ │ │ ├── ChevronLeft.tsx
│ │ │ ├── ChevronRight.tsx
│ │ │ ├── ChevronUpIcon.tsx
│ │ │ ├── CodeFileIcon.tsx
│ │ │ ├── CodeSandbox.tsx
│ │ │ ├── CompactListIcon.tsx
│ │ │ ├── ContentCopyIcon.tsx
│ │ │ ├── DarkToLightIcon.tsx
│ │ │ ├── DatabaseIcon.module.scss
│ │ │ ├── DatabaseIcon.tsx
│ │ │ ├── DocFileIcon.tsx
│ │ │ ├── DocIcon.tsx
│ │ │ ├── DotMenuHorizontalIcon.tsx
│ │ │ ├── DotMenuIcon.tsx
│ │ │ ├── EmailIcon.tsx
│ │ │ ├── EmptyFolderIcon.tsx
│ │ │ ├── ErrorIcon.tsx
│ │ │ ├── ExpressionIcon.tsx
│ │ │ ├── FillPlusCricleIcon.tsx
│ │ │ ├── FilterIcon.tsx
│ │ │ ├── FolderIcon.tsx
│ │ │ ├── GlobeIcon.tsx
│ │ │ ├── HomeIcon.tsx
│ │ │ ├── HyperLinkIcon.tsx
│ │ │ ├── Icon.md
│ │ │ ├── Icon.module.scss
│ │ │ ├── Icon.spec.ts
│ │ │ ├── Icon.tsx
│ │ │ ├── IconNative.tsx
│ │ │ ├── ImageFileIcon.tsx
│ │ │ ├── Inspect.tsx
│ │ │ ├── LightToDark.tsx
│ │ │ ├── LinkIcon.tsx
│ │ │ ├── ListIcon.tsx
│ │ │ ├── LooseListIcon.tsx
│ │ │ ├── MoonIcon.tsx
│ │ │ ├── MoreOptionsIcon.tsx
│ │ │ ├── NoSortIcon.tsx
│ │ │ ├── PDFIcon.tsx
│ │ │ ├── PenIcon.tsx
│ │ │ ├── PhoneIcon.tsx
│ │ │ ├── PhotoIcon.tsx
│ │ │ ├── PlusIcon.tsx
│ │ │ ├── SearchIcon.tsx
│ │ │ ├── ShareIcon.tsx
│ │ │ ├── SortAscendingIcon.tsx
│ │ │ ├── SortDescendingIcon.tsx
│ │ │ ├── StarsIcon.tsx
│ │ │ ├── SunIcon.tsx
│ │ │ ├── svg
│ │ │ │ ├── admonition_danger.svg
│ │ │ │ ├── admonition_info.svg
│ │ │ │ ├── admonition_note.svg
│ │ │ │ ├── admonition_tip.svg
│ │ │ │ ├── admonition_warning.svg
│ │ │ │ ├── api.svg
│ │ │ │ ├── arrow-dropdown.svg
│ │ │ │ ├── arrow-left.svg
│ │ │ │ ├── arrow-right.svg
│ │ │ │ ├── arrow-up.svg
│ │ │ │ ├── attach.svg
│ │ │ │ ├── binding.svg
│ │ │ │ ├── box.svg
│ │ │ │ ├── bulb.svg
│ │ │ │ ├── code-file.svg
│ │ │ │ ├── code-sandbox.svg
│ │ │ │ ├── dark_to_light.svg
│ │ │ │ ├── database.svg
│ │ │ │ ├── doc.svg
│ │ │ │ ├── empty-folder.svg
│ │ │ │ ├── expression.svg
│ │ │ │ ├── eye-closed.svg
│ │ │ │ ├── eye-dark.svg
│ │ │ │ ├── eye.svg
│ │ │ │ ├── file-text.svg
│ │ │ │ ├── filter.svg
│ │ │ │ ├── folder.svg
│ │ │ │ ├── img.svg
│ │ │ │ ├── inspect.svg
│ │ │ │ ├── light_to_dark.svg
│ │ │ │ ├── moon.svg
│ │ │ │ ├── pdf.svg
│ │ │ │ ├── photo.svg
│ │ │ │ ├── share.svg
│ │ │ │ ├── stars.svg
│ │ │ │ ├── sun.svg
│ │ │ │ ├── trending-down.svg
│ │ │ │ ├── trending-level.svg
│ │ │ │ ├── trending-up.svg
│ │ │ │ ├── txt.svg
│ │ │ │ ├── unknown-file.svg
│ │ │ │ ├── unlink.svg
│ │ │ │ └── xls.svg
│ │ │ ├── TableDeleteColumnIcon.tsx
│ │ │ ├── TableDeleteRowIcon.tsx
│ │ │ ├── TableInsertColumnIcon.tsx
│ │ │ ├── TableInsertRowIcon.tsx
│ │ │ ├── TrashIcon.tsx
│ │ │ ├── TrendingDownIcon.tsx
│ │ │ ├── TrendingLevelIcon.tsx
│ │ │ ├── TrendingUpIcon.tsx
│ │ │ ├── TxtIcon.tsx
│ │ │ ├── UnknownFileIcon.tsx
│ │ │ ├── UnlinkIcon.tsx
│ │ │ ├── UserIcon.tsx
│ │ │ ├── WarningIcon.tsx
│ │ │ └── XlsIcon.tsx
│ │ ├── IconProvider.tsx
│ │ ├── IconRegistryContext.tsx
│ │ ├── IFrame
│ │ │ ├── IFrame.md
│ │ │ ├── IFrame.module.scss
│ │ │ ├── IFrame.spec.ts
│ │ │ ├── IFrame.tsx
│ │ │ └── IFrameNative.tsx
│ │ ├── Image
│ │ │ ├── Image.md
│ │ │ ├── Image.module.scss
│ │ │ ├── Image.spec.ts
│ │ │ ├── Image.tsx
│ │ │ └── ImageNative.tsx
│ │ ├── Input
│ │ │ ├── index.ts
│ │ │ ├── InputAdornment.module.scss
│ │ │ ├── InputAdornment.tsx
│ │ │ ├── InputDivider.module.scss
│ │ │ ├── InputDivider.tsx
│ │ │ ├── InputLabel.module.scss
│ │ │ ├── InputLabel.tsx
│ │ │ ├── PartialInput.module.scss
│ │ │ └── PartialInput.tsx
│ │ ├── InspectButton
│ │ │ ├── InspectButton.module.scss
│ │ │ └── InspectButton.tsx
│ │ ├── Items
│ │ │ ├── Items.md
│ │ │ ├── Items.spec.ts
│ │ │ ├── Items.tsx
│ │ │ └── ItemsNative.tsx
│ │ ├── Link
│ │ │ ├── Link.md
│ │ │ ├── Link.module.scss
│ │ │ ├── Link.spec.ts
│ │ │ ├── Link.tsx
│ │ │ └── LinkNative.tsx
│ │ ├── List
│ │ │ ├── doc-resources
│ │ │ │ └── list-component-data.js
│ │ │ ├── List.md
│ │ │ ├── List.module.scss
│ │ │ ├── List.spec.ts
│ │ │ ├── List.tsx
│ │ │ └── ListNative.tsx
│ │ ├── Logo
│ │ │ ├── doc-resources
│ │ │ │ └── xmlui-logo.svg
│ │ │ ├── Logo.md
│ │ │ ├── Logo.tsx
│ │ │ └── LogoNative.tsx
│ │ ├── Markdown
│ │ │ ├── CodeText.module.scss
│ │ │ ├── CodeText.tsx
│ │ │ ├── Markdown.md
│ │ │ ├── Markdown.module.scss
│ │ │ ├── Markdown.spec.ts
│ │ │ ├── Markdown.tsx
│ │ │ ├── MarkdownNative.tsx
│ │ │ ├── parse-binding-expr.ts
│ │ │ └── utils.ts
│ │ ├── metadata-helpers.ts
│ │ ├── ModalDialog
│ │ │ ├── ConfirmationModalContextProvider.tsx
│ │ │ ├── Dialog.module.scss
│ │ │ ├── Dialog.tsx
│ │ │ ├── ModalDialog.md
│ │ │ ├── ModalDialog.module.scss
│ │ │ ├── ModalDialog.spec.ts
│ │ │ ├── ModalDialog.tsx
│ │ │ ├── ModalDialogNative.tsx
│ │ │ └── ModalVisibilityContext.tsx
│ │ ├── NavGroup
│ │ │ ├── NavGroup.md
│ │ │ ├── NavGroup.module.scss
│ │ │ ├── NavGroup.spec.ts
│ │ │ ├── NavGroup.tsx
│ │ │ ├── NavGroupContext.ts
│ │ │ └── NavGroupNative.tsx
│ │ ├── NavLink
│ │ │ ├── NavLink.md
│ │ │ ├── NavLink.module.scss
│ │ │ ├── NavLink.spec.ts
│ │ │ ├── NavLink.tsx
│ │ │ └── NavLinkNative.tsx
│ │ ├── NavPanel
│ │ │ ├── NavPanel.md
│ │ │ ├── NavPanel.module.scss
│ │ │ ├── NavPanel.spec.ts
│ │ │ ├── NavPanel.tsx
│ │ │ └── NavPanelNative.tsx
│ │ ├── NestedApp
│ │ │ ├── AppWithCodeView.module.scss
│ │ │ ├── AppWithCodeView.tsx
│ │ │ ├── AppWithCodeViewNative.tsx
│ │ │ ├── defaultProps.tsx
│ │ │ ├── logo.svg
│ │ │ ├── NestedApp.module.scss
│ │ │ ├── NestedApp.tsx
│ │ │ ├── NestedAppNative.tsx
│ │ │ ├── Tooltip.module.scss
│ │ │ ├── Tooltip.tsx
│ │ │ └── utils.ts
│ │ ├── NoResult
│ │ │ ├── NoResult.md
│ │ │ ├── NoResult.module.scss
│ │ │ ├── NoResult.spec.ts
│ │ │ ├── NoResult.tsx
│ │ │ └── NoResultNative.tsx
│ │ ├── NumberBox
│ │ │ ├── numberbox-abstractions.ts
│ │ │ ├── NumberBox.md
│ │ │ ├── NumberBox.module.scss
│ │ │ ├── NumberBox.spec.ts
│ │ │ ├── NumberBox.tsx
│ │ │ └── NumberBoxNative.tsx
│ │ ├── Option
│ │ │ ├── Option.md
│ │ │ ├── Option.spec.ts
│ │ │ ├── Option.tsx
│ │ │ ├── OptionNative.tsx
│ │ │ └── OptionTypeProvider.tsx
│ │ ├── PageMetaTitle
│ │ │ ├── PageMetaTilteNative.tsx
│ │ │ ├── PageMetaTitle.md
│ │ │ ├── PageMetaTitle.spec.ts
│ │ │ └── PageMetaTitle.tsx
│ │ ├── Pages
│ │ │ ├── Page.md
│ │ │ ├── Pages.md
│ │ │ ├── Pages.module.scss
│ │ │ ├── Pages.tsx
│ │ │ └── PagesNative.tsx
│ │ ├── Pagination
│ │ │ ├── Pagination.md
│ │ │ ├── Pagination.module.scss
│ │ │ ├── Pagination.spec.ts
│ │ │ ├── Pagination.tsx
│ │ │ └── PaginationNative.tsx
│ │ ├── PositionedContainer
│ │ │ ├── PositionedContainer.module.scss
│ │ │ ├── PositionedContainer.tsx
│ │ │ └── PositionedContainerNative.tsx
│ │ ├── ProfileMenu
│ │ │ ├── ProfileMenu.module.scss
│ │ │ └── ProfileMenu.tsx
│ │ ├── ProgressBar
│ │ │ ├── ProgressBar.md
│ │ │ ├── ProgressBar.module.scss
│ │ │ ├── ProgressBar.spec.ts
│ │ │ ├── ProgressBar.tsx
│ │ │ └── ProgressBarNative.tsx
│ │ ├── Queue
│ │ │ ├── Queue.md
│ │ │ ├── Queue.spec.ts
│ │ │ ├── Queue.tsx
│ │ │ ├── queueActions.ts
│ │ │ └── QueueNative.tsx
│ │ ├── RadioGroup
│ │ │ ├── RadioGroup.md
│ │ │ ├── RadioGroup.module.scss
│ │ │ ├── RadioGroup.spec.ts
│ │ │ ├── RadioGroup.tsx
│ │ │ ├── RadioGroupNative.tsx
│ │ │ ├── RadioItem.tsx
│ │ │ └── RadioItemNative.tsx
│ │ ├── RealTimeAdapter
│ │ │ ├── RealTimeAdapter.tsx
│ │ │ └── RealTimeAdapterNative.tsx
│ │ ├── Redirect
│ │ │ ├── Redirect.md
│ │ │ ├── Redirect.spec.ts
│ │ │ └── Redirect.tsx
│ │ ├── ResponsiveBar
│ │ │ ├── README.md
│ │ │ ├── ResponsiveBar.md
│ │ │ ├── ResponsiveBar.module.scss
│ │ │ ├── ResponsiveBar.spec.ts
│ │ │ ├── ResponsiveBar.tsx
│ │ │ └── ResponsiveBarNative.tsx
│ │ ├── Select
│ │ │ ├── HiddenOption.tsx
│ │ │ ├── OptionContext.ts
│ │ │ ├── Select.md
│ │ │ ├── Select.module.scss
│ │ │ ├── Select.spec.ts
│ │ │ ├── Select.tsx
│ │ │ ├── SelectContext.tsx
│ │ │ └── SelectNative.tsx
│ │ ├── SelectionStore
│ │ │ ├── SelectionStore.md
│ │ │ ├── SelectionStore.tsx
│ │ │ └── SelectionStoreNative.tsx
│ │ ├── Slider
│ │ │ ├── Slider.md
│ │ │ ├── Slider.module.scss
│ │ │ ├── Slider.spec.ts
│ │ │ ├── Slider.tsx
│ │ │ └── SliderNative.tsx
│ │ ├── Slot
│ │ │ ├── Slot.md
│ │ │ ├── Slot.spec.ts
│ │ │ └── Slot.ts
│ │ ├── SlotItem.tsx
│ │ ├── SpaceFiller
│ │ │ ├── SpaceFiller.md
│ │ │ ├── SpaceFiller.module.scss
│ │ │ ├── SpaceFiller.spec.ts
│ │ │ ├── SpaceFiller.tsx
│ │ │ └── SpaceFillerNative.tsx
│ │ ├── Spinner
│ │ │ ├── Spinner.md
│ │ │ ├── Spinner.module.scss
│ │ │ ├── Spinner.spec.ts
│ │ │ ├── Spinner.tsx
│ │ │ └── SpinnerNative.tsx
│ │ ├── Splitter
│ │ │ ├── HSplitter.md
│ │ │ ├── HSplitter.spec.ts
│ │ │ ├── Splitter.md
│ │ │ ├── Splitter.module.scss
│ │ │ ├── Splitter.spec.ts
│ │ │ ├── Splitter.tsx
│ │ │ ├── SplitterNative.tsx
│ │ │ ├── utils.ts
│ │ │ ├── VSplitter.md
│ │ │ └── VSplitter.spec.ts
│ │ ├── Stack
│ │ │ ├── CHStack.md
│ │ │ ├── CHStack.spec.ts
│ │ │ ├── CVStack.md
│ │ │ ├── CVStack.spec.ts
│ │ │ ├── HStack.md
│ │ │ ├── HStack.spec.ts
│ │ │ ├── Stack.md
│ │ │ ├── Stack.module.scss
│ │ │ ├── Stack.spec.ts
│ │ │ ├── Stack.tsx
│ │ │ ├── StackNative.tsx
│ │ │ ├── VStack.md
│ │ │ └── VStack.spec.ts
│ │ ├── StickyBox
│ │ │ ├── StickyBox.md
│ │ │ ├── StickyBox.module.scss
│ │ │ ├── StickyBox.tsx
│ │ │ └── StickyBoxNative.tsx
│ │ ├── Switch
│ │ │ ├── Switch.md
│ │ │ ├── Switch.spec.ts
│ │ │ └── Switch.tsx
│ │ ├── Table
│ │ │ ├── doc-resources
│ │ │ │ └── list-component-data.js
│ │ │ ├── react-table-config.d.ts
│ │ │ ├── Table.md
│ │ │ ├── Table.module.scss
│ │ │ ├── Table.spec.ts
│ │ │ ├── Table.tsx
│ │ │ ├── TableNative.tsx
│ │ │ └── useRowSelection.tsx
│ │ ├── TableOfContents
│ │ │ ├── TableOfContents.module.scss
│ │ │ ├── TableOfContents.spec.ts
│ │ │ ├── TableOfContents.tsx
│ │ │ └── TableOfContentsNative.tsx
│ │ ├── Tabs
│ │ │ ├── TabContext.tsx
│ │ │ ├── TabItem.md
│ │ │ ├── TabItem.tsx
│ │ │ ├── TabItemNative.tsx
│ │ │ ├── Tabs.md
│ │ │ ├── Tabs.module.scss
│ │ │ ├── Tabs.spec.ts
│ │ │ ├── Tabs.tsx
│ │ │ └── TabsNative.tsx
│ │ ├── Text
│ │ │ ├── Text.md
│ │ │ ├── Text.module.scss
│ │ │ ├── Text.spec.ts
│ │ │ ├── Text.tsx
│ │ │ └── TextNative.tsx
│ │ ├── TextArea
│ │ │ ├── TextArea.md
│ │ │ ├── TextArea.module.scss
│ │ │ ├── TextArea.spec.ts
│ │ │ ├── TextArea.tsx
│ │ │ ├── TextAreaNative.tsx
│ │ │ ├── TextAreaResizable.tsx
│ │ │ └── useComposedRef.ts
│ │ ├── TextBox
│ │ │ ├── TextBox.md
│ │ │ ├── TextBox.module.scss
│ │ │ ├── TextBox.spec.ts
│ │ │ ├── TextBox.tsx
│ │ │ └── TextBoxNative.tsx
│ │ ├── Theme
│ │ │ ├── NotificationToast.tsx
│ │ │ ├── Theme.md
│ │ │ ├── Theme.module.scss
│ │ │ ├── Theme.spec.ts
│ │ │ ├── Theme.tsx
│ │ │ └── ThemeNative.tsx
│ │ ├── TimeInput
│ │ │ ├── TimeInput.md
│ │ │ ├── TimeInput.module.scss
│ │ │ ├── TimeInput.spec.ts
│ │ │ ├── TimeInput.tsx
│ │ │ ├── TimeInputNative.tsx
│ │ │ └── utils.ts
│ │ ├── Timer
│ │ │ ├── Timer.md
│ │ │ ├── Timer.spec.ts
│ │ │ ├── Timer.tsx
│ │ │ └── TimerNative.tsx
│ │ ├── Toggle
│ │ │ ├── Toggle.module.scss
│ │ │ └── Toggle.tsx
│ │ ├── ToneChangerButton
│ │ │ ├── ToneChangerButton.md
│ │ │ ├── ToneChangerButton.spec.ts
│ │ │ └── ToneChangerButton.tsx
│ │ ├── ToneSwitch
│ │ │ ├── ToneSwitch.md
│ │ │ ├── ToneSwitch.module.scss
│ │ │ ├── ToneSwitch.spec.ts
│ │ │ ├── ToneSwitch.tsx
│ │ │ └── ToneSwitchNative.tsx
│ │ ├── Tooltip
│ │ │ ├── Tooltip.md
│ │ │ ├── Tooltip.module.scss
│ │ │ ├── Tooltip.spec.ts
│ │ │ ├── Tooltip.tsx
│ │ │ └── TooltipNative.tsx
│ │ ├── Tree
│ │ │ ├── testData.ts
│ │ │ ├── Tree-dynamic.spec.ts
│ │ │ ├── Tree-icons.spec.ts
│ │ │ ├── Tree.md
│ │ │ ├── Tree.spec.ts
│ │ │ ├── TreeComponent.module.scss
│ │ │ ├── TreeComponent.tsx
│ │ │ └── TreeNative.tsx
│ │ ├── TreeDisplay
│ │ │ ├── TreeDisplay.md
│ │ │ ├── TreeDisplay.module.scss
│ │ │ ├── TreeDisplay.tsx
│ │ │ └── TreeDisplayNative.tsx
│ │ ├── ValidationSummary
│ │ │ ├── ValidationSummary.module.scss
│ │ │ └── ValidationSummary.tsx
│ │ └── VisuallyHidden.tsx
│ ├── components-core
│ │ ├── abstractions
│ │ │ ├── ComponentRenderer.ts
│ │ │ ├── LoaderRenderer.ts
│ │ │ ├── standalone.ts
│ │ │ └── treeAbstractions.ts
│ │ ├── action
│ │ │ ├── actions.ts
│ │ │ ├── APICall.tsx
│ │ │ ├── FileDownloadAction.tsx
│ │ │ ├── FileUploadAction.tsx
│ │ │ ├── NavigateAction.tsx
│ │ │ └── TimedAction.tsx
│ │ ├── ApiBoundComponent.tsx
│ │ ├── appContext
│ │ │ ├── date-functions.ts
│ │ │ ├── math-function.ts
│ │ │ └── misc-utils.ts
│ │ ├── AppContext.tsx
│ │ ├── behaviors
│ │ │ ├── Behavior.tsx
│ │ │ └── CoreBehaviors.tsx
│ │ ├── component-hooks.ts
│ │ ├── ComponentDecorator.tsx
│ │ ├── ComponentViewer.tsx
│ │ ├── CompoundComponent.tsx
│ │ ├── constants.ts
│ │ ├── DebugViewProvider.tsx
│ │ ├── descriptorHelper.ts
│ │ ├── devtools
│ │ │ ├── InspectorDialog.module.scss
│ │ │ ├── InspectorDialog.tsx
│ │ │ └── InspectorDialogVisibilityContext.tsx
│ │ ├── EngineError.ts
│ │ ├── event-handlers.ts
│ │ ├── InspectorButton.module.scss
│ │ ├── InspectorContext.tsx
│ │ ├── interception
│ │ │ ├── abstractions.ts
│ │ │ ├── ApiInterceptor.ts
│ │ │ ├── ApiInterceptorProvider.tsx
│ │ │ ├── apiInterceptorWorker.ts
│ │ │ ├── Backend.ts
│ │ │ ├── Errors.ts
│ │ │ ├── IndexedDb.ts
│ │ │ ├── initMock.ts
│ │ │ ├── InMemoryDb.ts
│ │ │ ├── ReadonlyCollection.ts
│ │ │ └── useApiInterceptorContext.tsx
│ │ ├── loader
│ │ │ ├── ApiLoader.tsx
│ │ │ ├── DataLoader.tsx
│ │ │ ├── ExternalDataLoader.tsx
│ │ │ ├── Loader.tsx
│ │ │ ├── MockLoaderRenderer.tsx
│ │ │ └── PageableLoader.tsx
│ │ ├── LoaderComponent.tsx
│ │ ├── markup-check.ts
│ │ ├── parts.ts
│ │ ├── renderers.ts
│ │ ├── rendering
│ │ │ ├── AppContent.tsx
│ │ │ ├── AppRoot.tsx
│ │ │ ├── AppWrapper.tsx
│ │ │ ├── buildProxy.ts
│ │ │ ├── collectFnVarDeps.ts
│ │ │ ├── ComponentAdapter.tsx
│ │ │ ├── ComponentWrapper.tsx
│ │ │ ├── Container.tsx
│ │ │ ├── containers.ts
│ │ │ ├── ContainerWrapper.tsx
│ │ │ ├── ErrorBoundary.module.scss
│ │ │ ├── ErrorBoundary.tsx
│ │ │ ├── InvalidComponent.module.scss
│ │ │ ├── InvalidComponent.tsx
│ │ │ ├── nodeUtils.ts
│ │ │ ├── reducer.ts
│ │ │ ├── renderChild.tsx
│ │ │ ├── StandaloneComponent.tsx
│ │ │ ├── StateContainer.tsx
│ │ │ ├── UnknownComponent.module.scss
│ │ │ ├── UnknownComponent.tsx
│ │ │ └── valueExtractor.ts
│ │ ├── reportEngineError.ts
│ │ ├── RestApiProxy.ts
│ │ ├── script-runner
│ │ │ ├── asyncProxy.ts
│ │ │ ├── AttributeValueParser.ts
│ │ │ ├── bannedFunctions.ts
│ │ │ ├── BindingTreeEvaluationContext.ts
│ │ │ ├── eval-tree-async.ts
│ │ │ ├── eval-tree-common.ts
│ │ │ ├── eval-tree-sync.ts
│ │ │ ├── ParameterParser.ts
│ │ │ ├── process-statement-async.ts
│ │ │ ├── process-statement-common.ts
│ │ │ ├── process-statement-sync.ts
│ │ │ ├── ScriptingSourceTree.ts
│ │ │ ├── simplify-expression.ts
│ │ │ ├── statement-queue.ts
│ │ │ └── visitors.ts
│ │ ├── StandaloneApp.tsx
│ │ ├── StandaloneExtensionManager.ts
│ │ ├── TableOfContentsContext.tsx
│ │ ├── theming
│ │ │ ├── _themes.scss
│ │ │ ├── component-layout-resolver.ts
│ │ │ ├── extendThemeUtils.ts
│ │ │ ├── hvar.ts
│ │ │ ├── layout-resolver.ts
│ │ │ ├── parse-layout-props.ts
│ │ │ ├── StyleContext.tsx
│ │ │ ├── StyleRegistry.ts
│ │ │ ├── ThemeContext.tsx
│ │ │ ├── ThemeProvider.tsx
│ │ │ ├── themes
│ │ │ │ ├── base-utils.ts
│ │ │ │ ├── palette.ts
│ │ │ │ ├── root.ts
│ │ │ │ ├── solid.ts
│ │ │ │ ├── theme-colors.ts
│ │ │ │ └── xmlui.ts
│ │ │ ├── themeVars.module.scss
│ │ │ ├── themeVars.ts
│ │ │ ├── transformThemeVars.ts
│ │ │ └── utils.ts
│ │ ├── utils
│ │ │ ├── actionUtils.ts
│ │ │ ├── audio-utils.ts
│ │ │ ├── base64-utils.ts
│ │ │ ├── compound-utils.ts
│ │ │ ├── css-utils.ts
│ │ │ ├── DataLoaderQueryKeyGenerator.ts
│ │ │ ├── date-utils.ts
│ │ │ ├── extractParam.ts
│ │ │ ├── hooks.tsx
│ │ │ ├── LruCache.ts
│ │ │ ├── mergeProps.ts
│ │ │ ├── misc.ts
│ │ │ ├── request-params.ts
│ │ │ ├── statementUtils.ts
│ │ │ └── treeUtils.ts
│ │ └── xmlui-parser.ts
│ ├── index-standalone.ts
│ ├── index.scss
│ ├── index.ts
│ ├── language-server
│ │ ├── server-common.ts
│ │ ├── server-web-worker.ts
│ │ ├── server.ts
│ │ ├── services
│ │ │ ├── common
│ │ │ │ ├── docs-generation.ts
│ │ │ │ ├── lsp-utils.ts
│ │ │ │ ├── metadata-utils.ts
│ │ │ │ └── syntax-node-utilities.ts
│ │ │ ├── completion.ts
│ │ │ ├── diagnostic.ts
│ │ │ ├── format.ts
│ │ │ └── hover.ts
│ │ └── xmlui-metadata-generated.js
│ ├── logging
│ │ ├── LoggerContext.tsx
│ │ ├── LoggerInitializer.tsx
│ │ ├── LoggerService.ts
│ │ └── xmlui.ts
│ ├── logo.svg
│ ├── parsers
│ │ ├── common
│ │ │ ├── GenericToken.ts
│ │ │ ├── InputStream.ts
│ │ │ └── utils.ts
│ │ ├── scripting
│ │ │ ├── code-behind-collect.ts
│ │ │ ├── Lexer.ts
│ │ │ ├── modules.ts
│ │ │ ├── Parser.ts
│ │ │ ├── ParserError.ts
│ │ │ ├── ScriptingNodeTypes.ts
│ │ │ ├── TokenTrait.ts
│ │ │ ├── TokenType.ts
│ │ │ └── tree-visitor.ts
│ │ ├── style-parser
│ │ │ ├── errors.ts
│ │ │ ├── source-tree.ts
│ │ │ ├── StyleInputStream.ts
│ │ │ ├── StyleLexer.ts
│ │ │ ├── StyleParser.ts
│ │ │ └── tokens.ts
│ │ └── xmlui-parser
│ │ ├── CharacterCodes.ts
│ │ ├── diagnostics.ts
│ │ ├── fileExtensions.ts
│ │ ├── index.ts
│ │ ├── lint.ts
│ │ ├── parser.ts
│ │ ├── ParserError.ts
│ │ ├── scanner.ts
│ │ ├── syntax-kind.ts
│ │ ├── syntax-node.ts
│ │ ├── transform.ts
│ │ ├── utils.ts
│ │ ├── xmlui-serializer.ts
│ │ └── xmlui-tree.ts
│ ├── react-app-env.d.ts
│ ├── syntax
│ │ ├── monaco
│ │ │ ├── grammar.monacoLanguage.ts
│ │ │ ├── index.ts
│ │ │ ├── xmlui-dark.ts
│ │ │ ├── xmlui-light.ts
│ │ │ └── xmluiscript.monacoLanguage.ts
│ │ └── textMate
│ │ ├── index.ts
│ │ ├── xmlui-dark.json
│ │ ├── xmlui-light.json
│ │ ├── xmlui.json
│ │ └── xmlui.tmLanguage.json
│ ├── testing
│ │ ├── assertions.ts
│ │ ├── component-test-helpers.ts
│ │ ├── ComponentDrivers.ts
│ │ ├── drivers
│ │ │ ├── DateInputDriver.ts
│ │ │ ├── index.ts
│ │ │ ├── ModalDialogDriver.ts
│ │ │ ├── NumberBoxDriver.ts
│ │ │ ├── TextBoxDriver.ts
│ │ │ ├── TimeInputDriver.ts
│ │ │ ├── TimerDriver.ts
│ │ │ └── TreeDriver.ts
│ │ ├── fixtures.ts
│ │ ├── index.ts
│ │ ├── infrastructure
│ │ │ ├── index.html
│ │ │ ├── main.tsx
│ │ │ ├── public
│ │ │ │ ├── mockServiceWorker.js
│ │ │ │ ├── resources
│ │ │ │ │ ├── bell.svg
│ │ │ │ │ ├── box.svg
│ │ │ │ │ ├── doc.svg
│ │ │ │ │ ├── eye.svg
│ │ │ │ │ ├── flower-640x480.jpg
│ │ │ │ │ ├── sun.svg
│ │ │ │ │ ├── test-image-100x100.jpg
│ │ │ │ │ └── txt.svg
│ │ │ │ └── serve.json
│ │ │ └── TestBed.tsx
│ │ └── themed-app-test-helpers.ts
│ └── vite-env.d.ts
├── tests
│ ├── components
│ │ ├── CodeBlock
│ │ │ └── hightlight-code.test.ts
│ │ ├── playground-pattern.test.ts
│ │ └── Tree
│ │ └── Tree-states.test.ts
│ ├── components-core
│ │ ├── abstractions
│ │ │ └── treeAbstractions.test.ts
│ │ ├── container
│ │ │ └── buildProxy.test.ts
│ │ ├── interception
│ │ │ ├── orderBy.test.ts
│ │ │ ├── ReadOnlyCollection.test.ts
│ │ │ └── request-param-converter.test.ts
│ │ ├── scripts-runner
│ │ │ ├── AttributeValueParser.test.ts
│ │ │ ├── eval-tree-arrow-async.test.ts
│ │ │ ├── eval-tree-arrow.test.ts
│ │ │ ├── eval-tree-func-decl-async.test.ts
│ │ │ ├── eval-tree-func-decl.test.ts
│ │ │ ├── eval-tree-pre-post.test.ts
│ │ │ ├── eval-tree-regression.test.ts
│ │ │ ├── eval-tree.test.ts
│ │ │ ├── function-proxy.test.ts
│ │ │ ├── parser-regression.test.ts
│ │ │ ├── process-event.test.ts
│ │ │ ├── process-function.test.ts
│ │ │ ├── process-implicit-context.test.ts
│ │ │ ├── process-statement-asgn.test.ts
│ │ │ ├── process-statement-destruct.test.ts
│ │ │ ├── process-statement-regs.test.ts
│ │ │ ├── process-statement-sync.test.ts
│ │ │ ├── process-statement.test.ts
│ │ │ ├── process-switch-sync.test.ts
│ │ │ ├── process-switch.test.ts
│ │ │ ├── process-try-sync.test.ts
│ │ │ ├── process-try.test.ts
│ │ │ └── test-helpers.ts
│ │ ├── test-metadata-handler.ts
│ │ ├── theming
│ │ │ ├── border-segments.test.ts
│ │ │ ├── component-layout.resolver.test.ts
│ │ │ ├── layout-property-parser.test.ts
│ │ │ ├── layout-resolver.test.ts
│ │ │ ├── layout-resolver2.test.ts
│ │ │ ├── layout-vp-override.test.ts
│ │ │ └── padding-segments.test.ts
│ │ └── utils
│ │ ├── date-utils.test.ts
│ │ ├── format-human-elapsed-time.test.ts
│ │ └── LruCache.test.ts
│ ├── language-server
│ │ ├── completion.test.ts
│ │ ├── format.test.ts
│ │ ├── hover.test.ts
│ │ └── mockData.ts
│ └── parsers
│ ├── common
│ │ └── input-stream.test.ts
│ ├── markdown
│ │ └── parse-binding-expression.test.ts
│ ├── parameter-parser.test.ts
│ ├── paremeter-parser.test.ts
│ ├── scripting
│ │ ├── eval-tree-arrow.test.ts
│ │ ├── eval-tree-pre-post.test.ts
│ │ ├── eval-tree.test.ts
│ │ ├── function-proxy.test.ts
│ │ ├── lexer-literals.test.ts
│ │ ├── lexer-misc.test.ts
│ │ ├── module-parse.test.ts
│ │ ├── parser-arrow.test.ts
│ │ ├── parser-assignments.test.ts
│ │ ├── parser-binary.test.ts
│ │ ├── parser-destructuring.test.ts
│ │ ├── parser-errors.test.ts
│ │ ├── parser-expressions.test.ts
│ │ ├── parser-function.test.ts
│ │ ├── parser-literals.test.ts
│ │ ├── parser-primary.test.ts
│ │ ├── parser-regex.test.ts
│ │ ├── parser-statements.test.ts
│ │ ├── parser-unary.test.ts
│ │ ├── process-event.test.ts
│ │ ├── process-implicit-context.test.ts
│ │ ├── process-statement-asgn.test.ts
│ │ ├── process-statement-destruct.test.ts
│ │ ├── process-statement-regs.test.ts
│ │ ├── process-statement-sync.test.ts
│ │ ├── process-statement.test.ts
│ │ ├── process-switch-sync.test.ts
│ │ ├── process-switch.test.ts
│ │ ├── process-try-sync.test.ts
│ │ ├── process-try.test.ts
│ │ ├── simplify-expression.test.ts
│ │ ├── statement-hooks.test.ts
│ │ └── test-helpers.ts
│ ├── style-parser
│ │ ├── generateHvarChain.test.ts
│ │ ├── parseHVar.test.ts
│ │ ├── parser.test.ts
│ │ └── tokens.test.ts
│ └── xmlui
│ ├── lint.test.ts
│ ├── parser.test.ts
│ ├── scanner.test.ts
│ ├── transform.attr.test.ts
│ ├── transform.circular.test.ts
│ ├── transform.element.test.ts
│ ├── transform.errors.test.ts
│ ├── transform.escape.test.ts
│ ├── transform.regression.test.ts
│ ├── transform.script.test.ts
│ ├── transform.test.ts
│ └── xmlui.ts
├── tests-e2e
│ ├── api-bound-component-regression.spec.ts
│ ├── api-call-as-extracted-component.spec.ts
│ ├── assign-to-object-or-array-regression.spec.ts
│ ├── binding-regression.spec.ts
│ ├── children-as-template-context-vars.spec.ts
│ ├── compound-component.spec.ts
│ ├── context-vars-regression.spec.ts
│ ├── data-bindings.spec.ts
│ ├── datasource-and-api-usage-in-var.spec.ts
│ ├── datasource-direct-binding.spec.ts
│ ├── datasource-onLoaded-regression.spec.ts
│ ├── modify-array-item-regression.spec.ts
│ ├── namespaces.spec.ts
│ ├── push-to-array-regression.spec.ts
│ ├── screen-breakpoints.spec.ts
│ ├── scripting.spec.ts
│ ├── state-scope-in-pages.spec.ts
│ └── state-var-scopes.spec.ts
├── tsconfig.bin.json
├── tsconfig.json
├── tsconfig.node.json
├── vite.config.ts
└── vitest.config.ts
```
# Files
--------------------------------------------------------------------------------
/xmlui/src/components/Form/Form.spec.ts:
--------------------------------------------------------------------------------
```typescript
1 | import type { ApiInterceptorDefinition } from "../../components-core/interception/abstractions";
2 | import { labelPositionValues } from "../abstractions";
3 | import { expect, test } from "../../testing/fixtures";
4 | import { getElementStyle } from "../../testing/component-test-helpers";
5 |
6 | // Test data constants
7 | const errorDisplayInterceptor: ApiInterceptorDefinition = {
8 | initialize: `
9 | $state.items = {
10 | [10]: { name: "Smith", id: 10 }
11 | };
12 | $state.currentId = 10;
13 | `,
14 | operations: {
15 | "no-validation-error": {
16 | url: "/no-validation-error",
17 | method: "post",
18 | handler: `return true;`,
19 | },
20 | "general-validation-error": {
21 | url: "/general-validation-error",
22 | method: "post",
23 | handler: `
24 | throw Errors.HttpError(404,
25 | {
26 | message: "General error message from the backend",
27 | issues: [
28 | { message: "Error for the whole form", severity: "error" },
29 | { message: "Warning for the whole form", severity: "warning" },
30 | ]
31 | }
32 | );
33 | `,
34 | },
35 | "field-validation-error": {
36 | url: "/field-validation-error",
37 | method: "post",
38 | handler: `
39 | throw Errors.HttpError(404,
40 | {
41 | message: "Field error message from the backend",
42 | issues: [
43 | { field: "test", message: "Display warning", severity: "warning" },
44 | ]
45 | }
46 | );
47 | `,
48 | },
49 | },
50 | };
51 |
52 | // =============================================================================
53 | // BASIC FUNCTIONALITY TESTS
54 | // =============================================================================
55 |
56 | test.describe("Basic Functionality", () => {
57 | test("component renders with default props", async ({ initTestBed, createFormDriver }) => {
58 | await initTestBed(`<Form testId="form"/>`);
59 | const driver = await createFormDriver("form");
60 | await expect(driver.component).toBeVisible();
61 | });
62 |
63 | test("component renders with form items", async ({ initTestBed, page }) => {
64 | await initTestBed(`
65 | <Form>
66 | <FormItem label="Name" bindTo="name" />
67 | <FormItem label="Email" bindTo="email" />
68 | </Form>
69 | `);
70 |
71 | await expect(page.getByText("Name")).toBeVisible();
72 | await expect(page.getByText("Email")).toBeVisible();
73 | });
74 |
75 | test("component renders save and cancel buttons by default", async ({ initTestBed, page }) => {
76 | await initTestBed(`<Form/>`);
77 |
78 | await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();
79 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
80 | });
81 |
82 | test("component renders custom button labels", async ({ initTestBed, page }) => {
83 | await initTestBed(`
84 | <Form cancelLabel="Go Back" saveLabel="Submit"/>
85 | `);
86 |
87 | await expect(page.getByRole("button", { name: "Go Back" })).toBeVisible();
88 | await expect(page.getByRole("button", { name: "Submit" })).toBeVisible();
89 | });
90 |
91 | test("component swaps cancel and save button positions", async ({ initTestBed, page }) => {
92 | await initTestBed(`
93 | <Form swapCancelAndSave="true"/>
94 | `);
95 |
96 | const buttons = page.getByRole("button");
97 | await expect(buttons.first()).toHaveText("Save");
98 | await expect(buttons.last()).toHaveText("Cancel");
99 | });
100 |
101 | // =============================================================================
102 | // HIDE BUTTON ROW TESTS
103 | // =============================================================================
104 |
105 | test.describe("hideButtonRow property", () => {
106 | test("hides button row when set to true", async ({ initTestBed, page }) => {
107 | await initTestBed(`<Form hideButtonRow="true"/>`);
108 |
109 | await expect(page.getByRole("button", { name: "Cancel" })).not.toBeVisible();
110 | await expect(page.getByRole("button", { name: "Save" })).not.toBeVisible();
111 | });
112 |
113 | test("shows button row when set to false", async ({ initTestBed, page }) => {
114 | await initTestBed(`<Form hideButtonRow="false"/>`);
115 |
116 | await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();
117 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
118 | });
119 |
120 | test("shows button row by default when property not set", async ({ initTestBed, page }) => {
121 | await initTestBed(`<Form/>`);
122 |
123 | await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();
124 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
125 | });
126 |
127 | test("hides custom button row template when set to true", async ({ initTestBed, page }) => {
128 | await initTestBed(`
129 | <Form hideButtonRow="true">
130 | <property name="buttonRowTemplate">
131 | <Button label="Custom Save" type="submit" testId="customSave" />
132 | <Button label="Custom Cancel" type="button" testId="customCancel" />
133 | </property>
134 | </Form>
135 | `);
136 |
137 | await expect(page.getByTestId("customSave")).not.toBeVisible();
138 | await expect(page.getByTestId("customCancel")).not.toBeVisible();
139 | });
140 |
141 | test("overrides hideButtonRowUntilDirty when both are set", async ({
142 | initTestBed,
143 | page,
144 | createFormItemDriver,
145 | createTextBoxDriver,
146 | }) => {
147 | await initTestBed(`
148 | <Form hideButtonRow="true" hideButtonRowUntilDirty="true">
149 | <FormItem label="Name" bindTo="name" testId="nameField" />
150 | </Form>
151 | `);
152 |
153 | // Button row should be hidden even before making changes
154 | await expect(page.getByRole("button", { name: "Save" })).not.toBeVisible();
155 | await expect(page.getByRole("button", { name: "Cancel" })).not.toBeVisible();
156 |
157 | // Make the form dirty
158 | const driver = await createFormItemDriver("nameField");
159 | const input = await createTextBoxDriver(driver.input);
160 | await input.field.fill("John");
161 |
162 | // Button row should still be hidden even after making changes
163 | await expect(page.getByRole("button", { name: "Save" })).not.toBeVisible();
164 | await expect(page.getByRole("button", { name: "Cancel" })).not.toBeVisible();
165 | });
166 |
167 | test("handles null value gracefully", async ({ initTestBed, page }) => {
168 | await initTestBed(`<Form hideButtonRow="{null}"/>`);
169 |
170 | // Should show button row (default behavior)
171 | await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();
172 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
173 | });
174 |
175 | test("handles undefined value gracefully", async ({ initTestBed, page }) => {
176 | await initTestBed(`<Form hideButtonRow="{undefined}"/>`);
177 |
178 | // Should show button row (default behavior)
179 | await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();
180 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
181 | });
182 |
183 | test("handles string 'true' value", async ({ initTestBed, page }) => {
184 | await initTestBed(`<Form hideButtonRow="true"/>`);
185 |
186 | await expect(page.getByRole("button", { name: "Cancel" })).not.toBeVisible();
187 | await expect(page.getByRole("button", { name: "Save" })).not.toBeVisible();
188 | });
189 |
190 | test("handles string 'false' value", async ({ initTestBed, page }) => {
191 | await initTestBed(`<Form hideButtonRow="false"/>`);
192 |
193 | await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();
194 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
195 | });
196 |
197 | test("form submission still works with hidden button row via external submit", async ({
198 | initTestBed,
199 | page,
200 | createFormItemDriver,
201 | createTextBoxDriver,
202 | }) => {
203 | const { testStateDriver } = await initTestBed(`
204 | <Fragment>
205 | <Form id="testForm" hideButtonRow="true" onSubmit="arg => testState = arg">
206 | <FormItem label="Name" bindTo="name" testId="nameField" />
207 | <Button type="submit" label="External Submit" testId="externalSubmit" />
208 | </Form>
209 | </Fragment>
210 | `);
211 |
212 | const driver = await createFormItemDriver("nameField");
213 | const input = await createTextBoxDriver(driver.input);
214 | await input.field.fill("John Doe");
215 |
216 | await page.getByTestId("externalSubmit").click();
217 |
218 | const submittedData = await testStateDriver.testState();
219 | expect(submittedData).toEqual({ name: "John Doe" });
220 | });
221 | });
222 |
223 | // =============================================================================
224 | // HIDE BUTTON ROW UNTIL DIRTY TESTS
225 | // =============================================================================
226 |
227 | test.describe("hideButtonRowUntilDirty property", () => {
228 | test("hides button row initially when form is not dirty", async ({ initTestBed, page }) => {
229 | await initTestBed(`
230 | <Form hideButtonRowUntilDirty="true">
231 | <FormItem label="Name" bindTo="name" testId="nameField" />
232 | </Form>
233 | `);
234 |
235 | await expect(page.getByRole("button", { name: "Cancel" })).not.toBeVisible();
236 | await expect(page.getByRole("button", { name: "Save" })).not.toBeVisible();
237 | });
238 |
239 | test("shows button row when form becomes dirty", async ({
240 | initTestBed,
241 | page,
242 | createFormItemDriver,
243 | createTextBoxDriver,
244 | }) => {
245 | await initTestBed(`
246 | <Form hideButtonRowUntilDirty="true">
247 | <FormItem label="Name" bindTo="name" testId="nameField" />
248 | </Form>
249 | `);
250 |
251 | // Initially hidden
252 | await expect(page.getByRole("button", { name: "Save" })).not.toBeVisible();
253 |
254 | // Make form dirty
255 | const driver = await createFormItemDriver("nameField");
256 | const input = await createTextBoxDriver(driver.input);
257 | await input.field.fill("John");
258 |
259 | // Now visible
260 | await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();
261 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
262 | });
263 |
264 | test("keeps button row visible after form becomes dirty", async ({
265 | initTestBed,
266 | page,
267 | createFormItemDriver,
268 | createTextBoxDriver,
269 | }) => {
270 | await initTestBed(`
271 | <Form hideButtonRowUntilDirty="true">
272 | <FormItem label="Name" bindTo="name" testId="nameField" />
273 | </Form>
274 | `);
275 |
276 | const driver = await createFormItemDriver("nameField");
277 | const input = await createTextBoxDriver(driver.input);
278 |
279 | // Make form dirty
280 | await input.field.fill("John");
281 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
282 |
283 | // Clear the input (form is still dirty)
284 | await input.field.clear();
285 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
286 | });
287 |
288 | test("shows button row by default when property set to false", async ({
289 | initTestBed,
290 | page,
291 | }) => {
292 | await initTestBed(`
293 | <Form hideButtonRowUntilDirty="false">
294 | <FormItem label="Name" bindTo="name" testId="nameField" />
295 | </Form>
296 | `);
297 |
298 | await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();
299 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
300 | });
301 |
302 | test("shows button row by default when property not set", async ({ initTestBed, page }) => {
303 | await initTestBed(`
304 | <Form>
305 | <FormItem label="Name" bindTo="name" testId="nameField" />
306 | </Form>
307 | `);
308 |
309 | await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();
310 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
311 | });
312 |
313 | test("works with multiple form items", async ({
314 | initTestBed,
315 | page,
316 | createFormItemDriver,
317 | createTextBoxDriver,
318 | }) => {
319 | await initTestBed(`
320 | <Form hideButtonRowUntilDirty="true">
321 | <FormItem label="Name" bindTo="name" testId="nameField" />
322 | <FormItem label="Email" bindTo="email" testId="emailField" />
323 | </Form>
324 | `);
325 |
326 | // Initially hidden
327 | await expect(page.getByRole("button", { name: "Save" })).not.toBeVisible();
328 |
329 | // Modify second field
330 | const emailDriver = await createFormItemDriver("emailField");
331 | const emailInput = await createTextBoxDriver(emailDriver.input);
332 | await emailInput.field.fill("[email protected]");
333 |
334 | // Now visible
335 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
336 | });
337 |
338 | test("hides custom button row template until dirty", async ({
339 | initTestBed,
340 | page,
341 | createFormItemDriver,
342 | createTextBoxDriver,
343 | }) => {
344 | await initTestBed(`
345 | <Form hideButtonRowUntilDirty="true">
346 | <FormItem label="Name" bindTo="name" testId="nameField" />
347 | <property name="buttonRowTemplate">
348 | <Button label="Custom Save" type="submit" testId="customSave" />
349 | </property>
350 | </Form>
351 | `);
352 |
353 | // Initially hidden
354 | await expect(page.getByTestId("customSave")).not.toBeVisible();
355 |
356 | // Make form dirty
357 | const driver = await createFormItemDriver("nameField");
358 | const input = await createTextBoxDriver(driver.input);
359 | await input.field.fill("John");
360 |
361 | // Now visible
362 | await expect(page.getByTestId("customSave")).toBeVisible();
363 | });
364 |
365 | test("handles null value gracefully", async ({ initTestBed, page }) => {
366 | await initTestBed(`
367 | <Form hideButtonRowUntilDirty="{null}">
368 | <FormItem label="Name" bindTo="name" testId="nameField" />
369 | </Form>
370 | `);
371 |
372 | // Should show button row (default behavior)
373 | await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();
374 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
375 | });
376 |
377 | test("handles undefined value gracefully", async ({ initTestBed, page }) => {
378 | await initTestBed(`
379 | <Form hideButtonRowUntilDirty="{undefined}">
380 | <FormItem label="Name" bindTo="name" testId="nameField" />
381 | </Form>
382 | `);
383 |
384 | // Should show button row (default behavior)
385 | await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();
386 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
387 | });
388 |
389 | test("works with form initialized with data", async ({
390 | initTestBed,
391 | page,
392 | createFormItemDriver,
393 | createTextBoxDriver,
394 | }) => {
395 | await initTestBed(`
396 | <Form hideButtonRowUntilDirty="true" data="{{ name: 'Initial' }}">
397 | <FormItem label="Name" bindTo="name" testId="nameField" />
398 | </Form>
399 | `);
400 |
401 | // Initially hidden (form has data but is not dirty)
402 | await expect(page.getByRole("button", { name: "Save" })).not.toBeVisible();
403 |
404 | // Make form dirty
405 | const driver = await createFormItemDriver("nameField");
406 | const input = await createTextBoxDriver(driver.input);
407 | await input.field.fill("Modified");
408 |
409 | // Now visible
410 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
411 | });
412 |
413 | test("button row appears when checkbox is checked", async ({ initTestBed, page }) => {
414 | await initTestBed(`
415 | <Form hideButtonRowUntilDirty="true">
416 | <FormItem label="Accept Terms" bindTo="terms" type="checkbox" />
417 | </Form>
418 | `);
419 |
420 | // Initially hidden
421 | await expect(page.getByRole("button", { name: "Save" })).not.toBeVisible();
422 |
423 | // Check the checkbox
424 | const checkbox = page.getByRole("checkbox");
425 | await checkbox.check();
426 |
427 | // Now visible
428 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
429 | });
430 |
431 | test("button row appears when slider value changes", async ({ initTestBed, page }) => {
432 | await initTestBed(`
433 | <Form hideButtonRowUntilDirty="true">
434 | <FormItem label="Volume" bindTo="volume" type="slider" testId="volumeField" />
435 | </Form>
436 | `);
437 |
438 | // Initially hidden
439 | await expect(page.getByRole("button", { name: "Save" })).not.toBeVisible();
440 |
441 | // Move the slider using keyboard
442 | const slider = page.getByRole("slider");
443 | await slider.press("ArrowRight");
444 |
445 | // Now visible
446 | await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
447 | });
448 | });
449 |
450 | // =============================================================================
451 | // ENABLE SUBMIT PROPERTY TESTS
452 | // =============================================================================
453 |
454 | test.describe("enableSubmit property", () => {
455 | test("disables submit button when set to false", async ({ initTestBed, page }) => {
456 | await initTestBed(`<Form enableSubmit="false"/>`);
457 |
458 | const saveButton = page.getByRole("button", { name: "Save" });
459 | await expect(saveButton).toBeVisible();
460 | await expect(saveButton).toBeDisabled();
461 | });
462 |
463 | test("enables submit button when set to true", async ({ initTestBed, page }) => {
464 | await initTestBed(`<Form enableSubmit="true"/>`);
465 |
466 | const saveButton = page.getByRole("button", { name: "Save" });
467 | await expect(saveButton).toBeVisible();
468 | await expect(saveButton).toBeEnabled();
469 | });
470 |
471 | test("submit button is enabled by default when property not set", async ({
472 | initTestBed,
473 | page,
474 | }) => {
475 | await initTestBed(`<Form/>`);
476 |
477 | const saveButton = page.getByRole("button", { name: "Save" });
478 | await expect(saveButton).toBeEnabled();
479 | });
480 |
481 | test("prevents form submission when set to false", async ({ initTestBed, page }) => {
482 | const { testStateDriver } = await initTestBed(`
483 | <Form enableSubmit="false" onSubmit="arg => testState = arg">
484 | <FormItem label="Name" bindTo="name" testId="nameField" />
485 | </Form>
486 | `);
487 |
488 | const saveButton = page.getByRole("button", { name: "Save" });
489 | await expect(saveButton).toBeDisabled();
490 |
491 | // Verify form does not submit (button is disabled, so click won't work)
492 | await saveButton.click({ force: true }); // Force click on disabled button
493 |
494 | // testState should remain null since submit was prevented
495 | await expect.poll(testStateDriver.testState).toBeNull();
496 | });
497 |
498 | test("allows form submission when set to true", async ({
499 | initTestBed,
500 | page,
501 | createFormItemDriver,
502 | createTextBoxDriver,
503 | }) => {
504 | const { testStateDriver } = await initTestBed(`
505 | <Form enableSubmit="true" onSubmit="arg => testState = arg">
506 | <FormItem label="Name" bindTo="name" testId="nameField" />
507 | </Form>
508 | `);
509 |
510 | const driver = await createFormItemDriver("nameField");
511 | const input = await createTextBoxDriver(driver.input);
512 | await input.field.fill("John Doe");
513 |
514 | const saveButton = page.getByRole("button", { name: "Save" });
515 | await expect(saveButton).toBeEnabled();
516 | await saveButton.click();
517 |
518 | const submittedData = await testStateDriver.testState();
519 | expect(submittedData).toEqual({ name: "John Doe" });
520 | });
521 |
522 | test("handles null value gracefully (defaults to enabled)", async ({ initTestBed, page }) => {
523 | await initTestBed(`<Form enableSubmit="{null}"/>`);
524 |
525 | const saveButton = page.getByRole("button", { name: "Save" });
526 | await expect(saveButton).toBeEnabled();
527 | });
528 |
529 | test("handles string 'true' value", async ({ initTestBed, page }) => {
530 | await initTestBed(`<Form enableSubmit="true"/>`);
531 |
532 | const saveButton = page.getByRole("button", { name: "Save" });
533 | await expect(saveButton).toBeEnabled();
534 | });
535 |
536 | test("handles string 'false' value", async ({ initTestBed, page }) => {
537 | await initTestBed(`<Form enableSubmit="false"/>`);
538 |
539 | const saveButton = page.getByRole("button", { name: "Save" });
540 | await expect(saveButton).toBeDisabled();
541 | });
542 |
543 | test("does not affect cancel button", async ({ initTestBed, page }) => {
544 | await initTestBed(`<Form enableSubmit="false"/>`);
545 |
546 | const cancelButton = page.getByRole("button", { name: "Cancel" });
547 | await expect(cancelButton).toBeEnabled();
548 | });
549 |
550 | test("works with custom submit button label", async ({ initTestBed, page }) => {
551 | await initTestBed(`<Form enableSubmit="false" saveLabel="Submit Now"/>`);
552 |
553 | const submitButton = page.getByRole("button", { name: "Submit Now" });
554 | await expect(submitButton).toBeDisabled();
555 | });
556 |
557 | test("works together with form disabled state", async ({ initTestBed, page }) => {
558 | await initTestBed(`<Form enabled="false" enableSubmit="true"/>`);
559 |
560 | const saveButton = page.getByRole("button", { name: "Save" });
561 | // Form disabled takes precedence
562 | await expect(saveButton).toBeDisabled();
563 | });
564 | });
565 |
566 | // =============================================================================
567 | // DATA PROPERTY TESTS
568 | // =============================================================================
569 |
570 | test.describe("data property", () => {
571 | test("sets initial form data", async ({
572 | initTestBed,
573 | createFormItemDriver,
574 | createTextBoxDriver,
575 | }) => {
576 | await initTestBed(`
577 | <Form data="{{ name: 'John', age: 30 }}">
578 | <FormItem label="Name" bindTo="name" testId="nameField" />
579 | <FormItem label="Age" bindTo="age" type="integer" testId="ageField" />
580 | </Form>
581 | `);
582 |
583 | const nameDriver = await createFormItemDriver("nameField");
584 | const nameInput = await createTextBoxDriver(nameDriver.input);
585 | const ageDriver = await createFormItemDriver("ageField");
586 | const ageInput = await createTextBoxDriver(ageDriver.input);
587 |
588 | await expect(nameInput.field).toHaveValue("John");
589 | await expect(ageInput.field).toHaveValue("30");
590 | });
591 |
592 | test("handles null data gracefully", async ({ initTestBed, createFormDriver }) => {
593 | await initTestBed(`<Form data="{null}" testId="form"/>`);
594 | const driver = await createFormDriver("form");
595 | await expect(driver.component).toBeVisible();
596 | });
597 |
598 | test("handles undefined data gracefully", async ({ initTestBed, createFormDriver }) => {
599 | await initTestBed(`<Form data="{undefined}" testId="form"/>`);
600 | const driver = await createFormDriver("form");
601 | await expect(driver.component).toBeVisible();
602 | });
603 |
604 | test("handles empty object data", async ({ initTestBed, createFormDriver }) => {
605 | await initTestBed(`<Form data="{{}}" testId="form"/>`);
606 | const driver = await createFormDriver("form");
607 | await expect(driver.component).toBeVisible();
608 | });
609 | });
610 |
611 | // =============================================================================
612 | // ITEM LABEL POSITION TESTS
613 | // =============================================================================
614 |
615 | test.describe("itemLabelPosition property", () => {
616 | labelPositionValues.forEach((position) => {
617 | test(`sets item label position to ${position}`, async ({
618 | initTestBed,
619 | createFormItemDriver,
620 | }) => {
621 | await initTestBed(`
622 | <Form itemLabelPosition="${position}">
623 | <FormItem label="Test Label" bindTo="test" testId="testField" />
624 | </Form>
625 | `);
626 |
627 | const driver = await createFormItemDriver("testField");
628 | await expect(driver.label).toBeVisible();
629 | });
630 | });
631 |
632 | test("handles invalid itemLabelPosition gracefully", async ({
633 | initTestBed,
634 | createFormDriver,
635 | }) => {
636 | await initTestBed(`<Form itemLabelPosition="invalid" testId="form"/>`);
637 | const driver = await createFormDriver("form");
638 | await expect(driver.component).toBeVisible();
639 | });
640 | });
641 |
642 | // =============================================================================
643 | // ITEM LABEL WIDTH TESTS
644 | // =============================================================================
645 |
646 | test.describe("itemLabelWidth property", () => {
647 | test("sets custom label width", async ({ initTestBed, createFormItemDriver }) => {
648 | await initTestBed(`
649 | <Form itemLabelWidth="200px">
650 | <FormItem label="Test Label" bindTo="test" testId="testField" />
651 | </Form>
652 | `);
653 |
654 | const driver = await createFormItemDriver("testField");
655 | await expect(driver.label).toBeVisible();
656 | });
657 |
658 | test("handles numeric label width", async ({ initTestBed, createFormItemDriver }) => {
659 | await initTestBed(`
660 | <Form itemLabelWidth="150">
661 | <FormItem label="Test Label" bindTo="test" testId="testField" />
662 | </Form>
663 | `);
664 |
665 | const driver = await createFormItemDriver("testField");
666 | await expect(driver.label).toBeVisible();
667 | });
668 |
669 | test("handles invalid label width gracefully", async ({ initTestBed, createFormDriver }) => {
670 | await initTestBed(`<Form itemLabelWidth="invalid" testId="form"/>`);
671 | const driver = await createFormDriver("form");
672 | await expect(driver.component).toBeVisible();
673 | });
674 |
675 | test("handles theme variable", async ({ initTestBed, createFormItemDriver }) => {
676 | const spaceBase = 0.25; //rem
677 | const labelSize = 10;
678 | const widthInPx = labelSize * spaceBase * 16; //px
679 | await initTestBed(`
680 | <Theme space-base="${spaceBase}rem">
681 | <Form itemLabelWidth="$space-${labelSize}">
682 | <FormItem label="Test Label" bindTo="test" testId="testField" />
683 | </Form>
684 | </Theme>
685 | `);
686 | const driver = await createFormItemDriver("testField");
687 | const labelWidth = await getElementStyle(driver.label, "width");
688 | expect(labelWidth).toBe(`${widthInPx}px`);
689 | });
690 | });
691 |
692 | // =============================================================================
693 | // ITEM LABEL BREAK TESTS
694 | // =============================================================================
695 |
696 | test.describe("itemLabelBreak property", () => {
697 | test("enables label line breaking", async ({ initTestBed, createFormItemDriver }) => {
698 | await initTestBed(`
699 | <Form itemLabelBreak="true">
700 | <FormItem label="Very Long Label That Should Break" bindTo="test" testId="testField" />
701 | </Form>
702 | `);
703 |
704 | const driver = await createFormItemDriver("testField");
705 | await expect(driver.label).toBeVisible();
706 | });
707 |
708 | test("disables label line breaking", async ({ initTestBed, createFormItemDriver }) => {
709 | await initTestBed(`
710 | <Form itemLabelBreak="false">
711 | <FormItem label="Very Long Label That Should Not Break" bindTo="test" testId="testField" />
712 | </Form>
713 | `);
714 |
715 | const driver = await createFormItemDriver("testField");
716 | await expect(driver.label).toBeVisible();
717 | });
718 | });
719 |
720 | // =============================================================================
721 | // ENABLED PROPERTY TESTS
722 | // =============================================================================
723 |
724 | test.describe("enabled property", () => {
725 | test("disables save button when enabled is false", async ({ initTestBed, page }) => {
726 | await initTestBed(`
727 | <Form enabled="false">
728 | <FormItem label="Test" bindTo="test" />
729 | </Form>
730 | `);
731 |
732 | const saveButton = page.getByRole("button", { name: "Save" });
733 | await expect(saveButton).toBeDisabled();
734 | });
735 |
736 | test("enables form when enabled is true", async ({ initTestBed, page }) => {
737 | await initTestBed(`
738 | <Form enabled="true">
739 | <FormItem label="Test" bindTo="test" />
740 | </Form>
741 | `);
742 |
743 | const saveButton = page.getByRole("button", { name: "Save" });
744 | const cancelButton = page.getByRole("button", { name: "Cancel" });
745 |
746 | await expect(saveButton).toBeEnabled();
747 | await expect(cancelButton).toBeEnabled();
748 | });
749 | });
750 |
751 | // =============================================================================
752 | // BUTTON ROW TEMPLATE TESTS
753 | // =============================================================================
754 |
755 | test.describe("buttonRowTemplate property", () => {
756 | test("supports custom button row template", async ({ initTestBed, page }) => {
757 | await initTestBed(`
758 | <Form>
759 | <FormItem label="Test" bindTo="test" />
760 | <property name="buttonRowTemplate">
761 | <Button label="Custom Save" type="submit" />
762 | <Button label="Custom Cancel" type="button" />
763 | </property>
764 | </Form>
765 | `);
766 |
767 | await expect(page.getByRole("button", { name: "Custom Save" })).toBeVisible();
768 | await expect(page.getByRole("button", { name: "Custom Cancel" })).toBeVisible();
769 | });
770 | });
771 |
772 | // =============================================================================
773 | // EVENT TESTS
774 | // =============================================================================
775 |
776 | test.describe("Events", () => {
777 | test("onSubmit event fires with form data", async ({ initTestBed, page }) => {
778 | const { testStateDriver } = await initTestBed(`
779 | <Form data="{{ name: 'John', email: '[email protected]' }}" onSubmit="data => testState = data">
780 | <FormItem label="Name" bindTo="name" />
781 | <FormItem label="Email" bindTo="email" />
782 | </Form>
783 | `);
784 |
785 | await page.getByRole("button", { name: "Save" }).click();
786 |
787 | await expect.poll(testStateDriver.testState).toEqual({
788 | name: "John",
789 | email: "[email protected]",
790 | });
791 | });
792 |
793 | test("onCancel event fires when cancel button clicked", async ({ initTestBed, page }) => {
794 | const { testStateDriver } = await initTestBed(`
795 | <Form onCancel="testState = 'cancelled'">
796 | <FormItem label="Test" bindTo="test" />
797 | </Form>
798 | `);
799 |
800 | await page.getByRole("button", { name: "Cancel" }).click();
801 |
802 | await expect.poll(testStateDriver.testState).toEqual("cancelled");
803 | });
804 |
805 | test("onSuccess event fires on successful submission", async ({
806 | initTestBed,
807 | page,
808 | createFormDriver,
809 | }) => {
810 | const { testStateDriver } = await initTestBed(
811 | `
812 | <Form
813 | testId="form"
814 | submitUrl="/test-success"
815 | onSuccess="testState = 'success'; console.log('Submitted successfully')"
816 | data="{{ name: 'Test' }}">
817 | <FormItem label="Name" bindTo="name" />
818 | </Form>
819 | `,
820 | {
821 | apiInterceptor: {
822 | operations: {
823 | testSuccess: {
824 | url: "/test-success",
825 | method: "put",
826 | handler: `return { success: true };`,
827 | },
828 | },
829 | },
830 | },
831 | );
832 |
833 | const driver = await createFormDriver("form");
834 | await driver.submitForm();
835 | await expect.poll(testStateDriver.testState).toEqual("success");
836 | });
837 |
838 | test("onReset event fires when form is reset", async ({ initTestBed, page }) => {
839 | const { testStateDriver } = await initTestBed(`
840 | <Form
841 | id="testForm"
842 | onReset="testState = 'reset'"
843 | data="{{ name: 'Test' }}">
844 | <FormItem label="Name" bindTo="name" />
845 | <Button onClick="testForm.reset()" label="Reset Form" />
846 | </Form>
847 | `);
848 |
849 | await page.getByRole("button", { name: "Reset Form" }).click();
850 |
851 | await expect.poll(testStateDriver.testState).toEqual("reset");
852 | });
853 | });
854 |
855 | // =============================================================================
856 | // API TESTS
857 | // =============================================================================
858 |
859 | test.describe("APIs", () => {
860 | test("update method updates form data", async ({
861 | initTestBed,
862 | page,
863 | createFormItemDriver,
864 | createTextBoxDriver,
865 | }) => {
866 | await initTestBed(`
867 | <Form
868 | id="testForm"
869 | data="{{ name: 'Original', age: 25 }}">
870 | <FormItem label="Name" bindTo="name" testId="nameField" />
871 | <FormItem label="Age" bindTo="age" type="integer" testId="ageField" />
872 | <Button onClick="testForm.update({ name: 'Updated', age: 30 })" label="Update" />
873 | </Form>
874 | `);
875 |
876 | const nameDriver = await createFormItemDriver("nameField");
877 | const nameInput = await createTextBoxDriver(nameDriver.input);
878 | const ageDriver = await createFormItemDriver("ageField");
879 | const ageInput = await createTextBoxDriver(ageDriver.input);
880 |
881 | await expect(nameInput.field).toHaveValue("Original");
882 | await expect(ageInput.field).toHaveValue("25");
883 |
884 | await page.getByRole("button", { name: "Update" }).click();
885 |
886 | await expect(nameInput.field).toHaveValue("Updated");
887 | await expect(ageInput.field).toHaveValue("30");
888 | });
889 |
890 | test("reset method resets form to initial state", async ({
891 | initTestBed,
892 | page,
893 | createFormItemDriver,
894 | createTextBoxDriver,
895 | }) => {
896 | await initTestBed(`
897 | <Form
898 | id="testForm"
899 | data="{{ name: 'Initial' }}">
900 | <FormItem label="Name" bindTo="name" testId="nameField" />
901 | <Button onClick="testForm.reset()" label="Reset" />
902 | </Form>
903 | `);
904 |
905 | const nameDriver = await createFormItemDriver("nameField");
906 | const nameInput = await createTextBoxDriver(nameDriver.input);
907 |
908 | // Change the input value
909 | await nameInput.field.fill("Changed");
910 | await expect(nameInput.field).toHaveValue("Changed");
911 |
912 | // Reset the form
913 | await page.getByRole("button", { name: "Reset" }).click();
914 |
915 | await expect(nameInput.field).toHaveValue("Initial");
916 | });
917 |
918 | test("validate method returns validation results without submitting", async ({
919 | initTestBed,
920 | page,
921 | createFormItemDriver,
922 | createTextBoxDriver,
923 | }) => {
924 | const { testStateDriver } = await initTestBed(`
925 | <Form id="testForm">
926 | <FormItem label="Name" bindTo="name" required="true" testId="nameField" />
927 | <FormItem label="Email" bindTo="email" testId="emailField" />
928 | <Button onClick="testState = testForm.validate()" label="Validate" testId="validateBtn" />
929 | </Form>
930 | `);
931 |
932 | // Click validate button without filling required field
933 | await page.getByTestId("validateBtn").click();
934 |
935 | // Wait for validation to complete
936 | await page.waitForTimeout(100);
937 |
938 | const result = await testStateDriver.testState();
939 | expect(result).toBeTruthy();
940 | expect(result.isValid).toBe(false);
941 | expect(result.errors).toBeDefined();
942 | expect(result.errors.length).toBeGreaterThan(0);
943 | });
944 |
945 | test("validate method returns isValid true when all validations pass", async ({
946 | initTestBed,
947 | page,
948 | createFormItemDriver,
949 | createTextBoxDriver,
950 | }) => {
951 | const { testStateDriver } = await initTestBed(`
952 | <Form id="testForm">
953 | <FormItem label="Name" bindTo="name" required="true" testId="nameField" />
954 | <Button onClick="testState = testForm.validate()" label="Validate" testId="validateBtn" />
955 | </Form>
956 | `);
957 |
958 | // Fill the required field
959 | const nameDriver = await createFormItemDriver("nameField");
960 | const nameInput = await createTextBoxDriver(nameDriver.input);
961 | await nameInput.field.fill("John Doe");
962 |
963 | // Click validate button
964 | await page.getByTestId("validateBtn").click();
965 |
966 | // Wait for validation to complete
967 | await page.waitForTimeout(100);
968 |
969 | const result = await testStateDriver.testState();
970 | expect(result).toBeTruthy();
971 | expect(result.isValid).toBe(true);
972 | expect(result.errors.length).toBe(0);
973 | });
974 |
975 | test("validate method returns cleaned form data", async ({
976 | initTestBed,
977 | page,
978 | createFormItemDriver,
979 | createTextBoxDriver,
980 | }) => {
981 | const { testStateDriver } = await initTestBed(`
982 | <Form id="testForm">
983 | <FormItem label="Name" bindTo="name" testId="nameField" />
984 | <FormItem label="Age" bindTo="age" type="integer" testId="ageField" />
985 | <Button onClick="testState = testForm.validate()" label="Validate" testId="validateBtn" />
986 | </Form>
987 | `);
988 |
989 | // Fill form fields
990 | const nameDriver = await createFormItemDriver("nameField");
991 | const nameInput = await createTextBoxDriver(nameDriver.input);
992 | await nameInput.field.fill("John Doe");
993 |
994 | const ageDriver = await createFormItemDriver("ageField");
995 | const ageInput = await createTextBoxDriver(ageDriver.input);
996 | await ageInput.field.fill("30");
997 |
998 | // Click validate button
999 | await page.getByTestId("validateBtn").click();
1000 |
1001 | // Wait for validation to complete
1002 | await page.waitForTimeout(100);
1003 |
1004 | const result = await testStateDriver.testState();
1005 | expect(result).toBeTruthy();
1006 | expect(result.data).toEqual({ name: "John Doe", age: "30" });
1007 | });
1008 |
1009 | test("validate method displays validation errors on form", async ({
1010 | initTestBed,
1011 | page,
1012 | createFormItemDriver,
1013 | }) => {
1014 | await initTestBed(`
1015 | <Form id="testForm">
1016 | <FormItem label="Name" bindTo="name" required="true" testId="nameField" />
1017 | <Button onClick="testForm.validate()" label="Validate" testId="validateBtn" />
1018 | </Form>
1019 | `);
1020 |
1021 | // Click validate without filling required field
1022 | await page.getByTestId("validateBtn").click();
1023 |
1024 | // Validation error should be displayed
1025 | const nameField = page.getByTestId("nameField");
1026 | await expect(nameField).toContainText("This field is required");
1027 | });
1028 |
1029 | test("validate method does not trigger form submission", async ({
1030 | initTestBed,
1031 | page,
1032 | createFormItemDriver,
1033 | createTextBoxDriver,
1034 | }) => {
1035 | const { testStateDriver } = await initTestBed(`
1036 | <Form id="testForm" onSubmit="testState = 'submitted'">
1037 | <FormItem label="Name" bindTo="name" testId="nameField" />
1038 | <Button onClick="testForm.validate()" label="Validate" testId="validateBtn" />
1039 | </Form>
1040 | `);
1041 |
1042 | // Fill form
1043 | const nameDriver = await createFormItemDriver("nameField");
1044 | const nameInput = await createTextBoxDriver(nameDriver.input);
1045 | await nameInput.field.fill("John");
1046 |
1047 | // Click validate button
1048 | await page.getByTestId("validateBtn").click();
1049 |
1050 | // Wait a bit
1051 | await page.waitForTimeout(200);
1052 |
1053 | // testState should remain null (not 'submitted')
1054 | await expect.poll(testStateDriver.testState).toBeNull();
1055 | });
1056 |
1057 | test("validate method returns complete validation results object", async ({
1058 | initTestBed,
1059 | page,
1060 | createFormItemDriver,
1061 | createTextBoxDriver,
1062 | }) => {
1063 | const { testStateDriver } = await initTestBed(`
1064 | <Form id="testForm">
1065 | <FormItem label="Name" bindTo="name" required="true" testId="nameField" />
1066 | <FormItem label="Email" bindTo="email" testId="emailField" />
1067 | <Button onClick="testState = testForm.validate()" label="Validate" testId="validateBtn" />
1068 | </Form>
1069 | `);
1070 |
1071 | // Fill only email (name is required)
1072 | const emailDriver = await createFormItemDriver("emailField");
1073 | const emailInput = await createTextBoxDriver(emailDriver.input);
1074 | await emailInput.field.fill("[email protected]");
1075 |
1076 | // Click validate button
1077 | await page.getByTestId("validateBtn").click();
1078 |
1079 | // Wait for validation to complete
1080 | await page.waitForTimeout(100);
1081 |
1082 | const result = await testStateDriver.testState();
1083 | expect(result).toBeTruthy();
1084 | expect(result.isValid).toBeDefined();
1085 | expect(result.data).toBeDefined();
1086 | expect(result.errors).toBeDefined();
1087 | expect(result.warnings).toBeDefined();
1088 | expect(result.validationResults).toBeDefined();
1089 | });
1090 | });
1091 |
1092 | // =============================================================================
1093 | // CONTEXT VARIABLE TESTS
1094 | // =============================================================================
1095 |
1096 | test.describe("Context Variables", () => {
1097 | test("$data context variable provides access to form data", async ({
1098 | initTestBed,
1099 | page,
1100 | createFormItemDriver,
1101 | }) => {
1102 | // This test needs specific FormItem behavior that may vary
1103 | await initTestBed(`
1104 | <Form data="{{ isEnabled: true, name: 'Joe' }}">
1105 | <FormItem testId="isEnabled" label="Enable name" bindTo="isEnabled" type="checkbox" />
1106 | <FormItem testId="name" enabled="{$data.isEnabled}" label="Name" bindTo="name" />
1107 | </Form>
1108 | `);
1109 |
1110 | const enableSwitch = (await createFormItemDriver("isEnabled")).checkbox;
1111 | const nameInput = (await createFormItemDriver("name")).textBox;
1112 |
1113 | await expect(enableSwitch).toBeVisible();
1114 | await expect(nameInput).toBeEnabled();
1115 | await enableSwitch.click();
1116 | await expect(nameInput).toBeDisabled();
1117 | });
1118 |
1119 | test("$data.update method updates form data", async ({
1120 | initTestBed,
1121 | page,
1122 | createFormItemDriver,
1123 | }) => {
1124 | await initTestBed(`
1125 | <Form data="{{ counter: 0 }}">
1126 | <FormItem testId="counter" label="Counter" bindTo="counter" type="integer" />
1127 | <Button onClick="$data.update({ counter: $data.counter + 1 })" label="Increment" />
1128 | </Form>
1129 | `);
1130 |
1131 | const counterDriver = await createFormItemDriver("counter");
1132 | const counterInput = counterDriver.textBox;
1133 | await expect(counterInput).toHaveValue("0");
1134 |
1135 | await page.getByRole("button", { name: "Increment" }).click({ force: true });
1136 |
1137 | await expect(counterInput).toHaveValue("1");
1138 | });
1139 | });
1140 |
1141 | // =============================================================================
1142 | // SUBMIT URL AND METHOD TESTS
1143 | // =============================================================================
1144 |
1145 | test.describe("Submit URL and Method", () => {
1146 | test("submits to custom URL with POST method (new date)", async ({
1147 | initTestBed,
1148 | createFormDriver,
1149 | }) => {
1150 | await initTestBed(
1151 | `<App><Form testId="form" submitUrl="/custom-endpoint" data="{null}">
1152 | <FormItem label="Name" bindTo="name" />
1153 | </Form></App>`,
1154 | {
1155 | apiInterceptor: {
1156 | operations: {
1157 | customEndpoint: {
1158 | url: "/custom-endpoint",
1159 | method: "post",
1160 | handler: `return { success: true };`,
1161 | },
1162 | },
1163 | },
1164 | },
1165 | );
1166 |
1167 | const driver = await createFormDriver("form");
1168 | await driver.submitForm();
1169 |
1170 | const response = await driver.getSubmitResponse("/custom-endpoint");
1171 | expect(response.ok()).toEqual(true);
1172 | });
1173 |
1174 | test("uses PUT method for existing data", async ({ initTestBed, createFormDriver }) => {
1175 | await initTestBed(
1176 | `<Form submitUrl="/entities/1" data="{{ id: 1, name: 'Existing' }}">
1177 | <FormItem label="Name" bindTo="name" />
1178 | </Form>`,
1179 | {
1180 | apiInterceptor: {
1181 | operations: {
1182 | updateEntity: {
1183 | url: "/entities/1",
1184 | method: "put",
1185 | handler: `return { success: true };`,
1186 | },
1187 | },
1188 | },
1189 | },
1190 | );
1191 |
1192 | const driver = await createFormDriver();
1193 | await driver.submitForm();
1194 |
1195 | const response = await driver.getSubmitResponse("/entities/1");
1196 | expect(response.ok()).toEqual(true);
1197 | });
1198 |
1199 | test("uses custom submit method", async ({ initTestBed, createFormDriver }) => {
1200 | await initTestBed(
1201 | `<Form submitUrl="/custom" submitMethod="put" data="{{ name: 'Test' }}">
1202 | <FormItem label="Name" bindTo="name" />
1203 | </Form>`,
1204 | {
1205 | apiInterceptor: {
1206 | operations: {
1207 | putCustom: {
1208 | url: "/custom",
1209 | method: "put",
1210 | handler: `return { success: true };`,
1211 | },
1212 | },
1213 | },
1214 | },
1215 | );
1216 |
1217 | const driver = await createFormDriver();
1218 | await driver.submitForm();
1219 |
1220 | const response = await driver.getSubmitResponse("/custom");
1221 | expect(response.ok()).toEqual(true);
1222 | });
1223 | });
1224 | });
1225 |
1226 | // =============================================================================
1227 | // ACCESSIBILITY TESTS
1228 | // =============================================================================
1229 |
1230 | test.describe("Accessibility", () => {
1231 | test("form has correct semantic role", async ({ initTestBed, page }) => {
1232 | await initTestBed(`<Form/>`);
1233 | await expect(page.locator("form")).toBeVisible();
1234 | });
1235 |
1236 | test("form items are properly associated with labels", async ({
1237 | initTestBed,
1238 | createFormItemDriver,
1239 | }) => {
1240 | await initTestBed(`
1241 | <Form>
1242 | <FormItem label="Full Name" bindTo="name" testId="nameField" />
1243 | </Form>
1244 | `);
1245 |
1246 | const driver = await createFormItemDriver("nameField");
1247 | await expect(driver.label).toBeVisible();
1248 | await expect(driver.label).toHaveText("Full Name");
1249 | });
1250 |
1251 | test("form submission is keyboard accessible", async ({ initTestBed, page }) => {
1252 | const { testStateDriver } = await initTestBed(`
1253 | <Form onSubmit="testState = 'submitted via keyboard'">
1254 | <FormItem label="Name" bindTo="name" />
1255 | </Form>
1256 | `);
1257 |
1258 | const submitButton = page.getByRole("button", { name: "Save" });
1259 | await submitButton.focus();
1260 | await page.keyboard.press("Enter");
1261 |
1262 | await expect.poll(testStateDriver.testState).toEqual("submitted via keyboard");
1263 | });
1264 |
1265 | test("form cancel is keyboard accessible", async ({ initTestBed, page }) => {
1266 | const { testStateDriver } = await initTestBed(`
1267 | <Form onCancel="testState = 'cancelled via keyboard'">
1268 | <FormItem label="Name" bindTo="name" />
1269 | </Form>
1270 | `);
1271 |
1272 | const cancelButton = page.getByRole("button", { name: "Cancel" });
1273 | await cancelButton.focus();
1274 | await page.keyboard.press("Enter");
1275 |
1276 | await expect.poll(testStateDriver.testState).toEqual("cancelled via keyboard");
1277 | });
1278 |
1279 | test("disabled form buttons are properly disabled", async ({ initTestBed, page }) => {
1280 | await initTestBed(`
1281 | <Form enabled="false">
1282 | <FormItem label="Name" bindTo="name" />
1283 | </Form>
1284 | `);
1285 |
1286 | const saveButton = page.getByRole("button", { name: "Save" });
1287 | await expect(saveButton).toBeDisabled();
1288 | });
1289 | });
1290 |
1291 | // =============================================================================
1292 | // THEME VARIABLE TESTS
1293 | // =============================================================================
1294 |
1295 | test.describe("Theme Variables", () => {
1296 | test("applies custom gap theme variable", async ({ initTestBed, createFormDriver }) => {
1297 | await initTestBed(`<Form testId="form"/>`, {
1298 | testThemeVars: {
1299 | "gap-Form": "2rem",
1300 | },
1301 | });
1302 |
1303 | const driver = await createFormDriver("form");
1304 | await expect(driver.component).toHaveCSS("gap", "32px");
1305 | });
1306 |
1307 | test("applies custom button row gap theme variable", async ({
1308 | initTestBed,
1309 | createFormDriver,
1310 | }) => {
1311 | await initTestBed(`<Form testId="form"/>`, {
1312 | testThemeVars: {
1313 | "gap-buttonRow-Form": "1rem",
1314 | },
1315 | });
1316 |
1317 | const driver = await createFormDriver("form");
1318 | await expect(driver.component).toBeVisible();
1319 | });
1320 |
1321 | test("applies validation display theme variables", async ({ initTestBed, page }) => {
1322 | // This test requires validation system to trigger error display
1323 | await initTestBed(
1324 | `
1325 | <Form>
1326 | <FormItem testId="email" label="Email" bindTo="email" type="email" required="true" />
1327 | </Form>
1328 | `,
1329 | {
1330 | testThemeVars: {
1331 | "backgroundColor-ValidationDisplay-error": "rgb(255, 0, 0)",
1332 | "textColor-ValidationDisplay-error": "rgb(255, 255, 255)",
1333 | },
1334 | },
1335 | );
1336 |
1337 | // Trigger validation by submitting with empty required field
1338 | await page.getByRole("button", { name: "Save" }).click();
1339 |
1340 | const emailComp = page.getByTestId("email");
1341 | await expect(emailComp).toContainText("This field is required");
1342 | });
1343 | });
1344 |
1345 | // =============================================================================
1346 | // EDGE CASES TESTS
1347 | // =============================================================================
1348 |
1349 | test.describe("Edge Cases", () => {
1350 | test("handles form without any form items", async ({ initTestBed, createFormDriver }) => {
1351 | await initTestBed(`<Form testId="form"/>`);
1352 | const driver = await createFormDriver("form");
1353 | await expect(driver.component).toBeVisible();
1354 | });
1355 |
1356 | test("handles malformed data input gracefully", async ({ initTestBed, createFormDriver }) => {
1357 | await initTestBed(`<Form data="{invalidJson}" testId="form"/>`);
1358 | const driver = await createFormDriver("form");
1359 | await expect(driver.component).toBeVisible();
1360 | });
1361 |
1362 | test("Form does not render if data receives malformed input", async ({
1363 | initTestBed,
1364 | createFormDriver,
1365 | }) => {
1366 | await initTestBed(`<Form data="{}" />`);
1367 | await expect((await createFormDriver()).component).not.toBeAttached();
1368 | });
1369 |
1370 | test("handles deeply nested data structure", async ({
1371 | initTestBed,
1372 | createFormItemDriver,
1373 | createTextBoxDriver,
1374 | }) => {
1375 | await initTestBed(`
1376 | <Form data="{{ user: { profile: { name: 'John' } } }}">
1377 | <FormItem label="Name" bindTo="user.profile.name" testId="nameField" />
1378 | </Form>
1379 | `);
1380 |
1381 | const driver = await createFormItemDriver("nameField");
1382 | const input = await createTextBoxDriver(driver.input);
1383 | await expect(input.field).toHaveValue("John");
1384 | });
1385 |
1386 | test("handles form with validation errors", async ({ initTestBed, page }) => {
1387 | await initTestBed(`
1388 | <Form>
1389 | <FormItem label="Email" bindTo="email" type="email" required="true" />
1390 | </Form>
1391 | `);
1392 |
1393 | // Try to submit form without filling required field
1394 | await page.getByRole("button", { name: "Save" }).click();
1395 |
1396 | // Validation should prevent submission and show error
1397 | const form = page.locator("form");
1398 | await expect(form).toBeVisible();
1399 | });
1400 |
1401 | test("handles rapid form submissions", async ({ initTestBed, page }) => {
1402 | const { testStateDriver } = await initTestBed(`
1403 | <Form onSubmit="testState = (testState || 0) + 1">
1404 | <FormItem label="Name" bindTo="name" />
1405 | </Form>
1406 | `);
1407 |
1408 | const submitButton = page.getByRole("button", { name: "Save" });
1409 |
1410 | // Click submit button multiple times rapidly
1411 | await submitButton.click();
1412 | await submitButton.click();
1413 | await submitButton.click();
1414 |
1415 | // Should only submit once or handle gracefully
1416 | await expect.poll(testStateDriver.testState).toBeGreaterThanOrEqual(1);
1417 | });
1418 |
1419 | test("handles null and undefined in nested data", async ({
1420 | initTestBed,
1421 | createFormItemDriver,
1422 | createTextBoxDriver,
1423 | }) => {
1424 | await initTestBed(`
1425 | <Form data="{{ user: null, settings: undefined, name: 'Test' }}">
1426 | <FormItem label="Name" bindTo="name" testId="nameField" />
1427 | </Form>
1428 | `);
1429 |
1430 | const driver = await createFormItemDriver("nameField");
1431 | const input = await createTextBoxDriver(driver.input);
1432 | await expect(input.field).toHaveValue("Test");
1433 | });
1434 |
1435 | test("handles form with empty string properties", async ({ initTestBed, page }) => {
1436 | await initTestBed(`
1437 | <Form
1438 | cancelLabel=""
1439 | saveLabel=""
1440 | data="{{ name: '' }}">
1441 | <FormItem label="Name" bindTo="name" />
1442 | </Form>
1443 | `);
1444 |
1445 | // Form should still be visible
1446 | const form = page.locator("form");
1447 | await expect(form).toBeVisible();
1448 | });
1449 |
1450 | test("handles special characters in form data", async ({
1451 | initTestBed,
1452 | createFormItemDriver,
1453 | createTextBoxDriver,
1454 | }) => {
1455 | await initTestBed(`
1456 | <Form data="{{ name: 'José María', description: 'Test & symbols' }}">
1457 | <FormItem label="Name" bindTo="name" testId="nameField" />
1458 | <FormItem label="Description" bindTo="description" testId="descField" />
1459 | </Form>
1460 | `);
1461 |
1462 | const nameDriver = await createFormItemDriver("nameField");
1463 | const nameInput = await createTextBoxDriver(nameDriver.input);
1464 | const descDriver = await createFormItemDriver("descField");
1465 | const descInput = await createTextBoxDriver(descDriver.input);
1466 |
1467 | await expect(nameInput.field).toHaveValue("José María");
1468 | await expect(descInput.field).toHaveValue("Test & symbols");
1469 | });
1470 |
1471 | test("user cannot submit with clientside errors present", async ({
1472 | initTestBed,
1473 | createFormDriver,
1474 | }) => {
1475 | const { testStateDriver } = await initTestBed(`
1476 | <Form onSubmit="testState = true">
1477 | <FormItem bindTo="name" required="true" />
1478 | </Form>
1479 | `);
1480 | const driver = await createFormDriver();
1481 |
1482 | // The onSubmit event should have been triggered if not for the client error of an empty required field
1483 | await driver.submitForm("click");
1484 | await expect.poll(testStateDriver.testState).toEqual(null);
1485 | });
1486 |
1487 | test("can submit with invisible required field", async ({
1488 | initTestBed,
1489 | createFormDriver,
1490 | createFormItemDriver,
1491 | createTextBoxDriver,
1492 | page,
1493 | }) => {
1494 | const { testStateDriver } = await initTestBed(`
1495 | <Form onSubmit="testState = true">
1496 | <FormItem testId="select" bindTo="authenticationType"
1497 | type="select" label="Authentication Type:" initialValue="{0}">
1498 | <Option value="{0}" label="Password" />
1499 | <Option value="{1}" label="Public Key" />
1500 | </FormItem>
1501 | <FormItem label="name1" testId="name1" bindTo="name1"
1502 | required="true" when="{$data.authenticationType == 0}"/>
1503 | <FormItem label="name2" testId="name2" bindTo="name2"
1504 | required="true" when="{$data.authenticationType == 1}"/>
1505 | </Form>
1506 | `);
1507 | const formDriver = await createFormDriver();
1508 | const selectDriver = await createFormItemDriver("select");
1509 | const textfieldElement = (await createFormItemDriver("name2")).input;
1510 | const textfieldDriver = await createTextBoxDriver(textfieldElement);
1511 |
1512 | await selectDriver.component.click();
1513 | await page.getByText("Public Key").click();
1514 | await textfieldDriver.field.fill("John");
1515 | await formDriver.submitForm();
1516 |
1517 | await expect.poll(testStateDriver.testState).toEqual(true);
1518 | });
1519 |
1520 | test("conditional fields keep the state", async ({
1521 | initTestBed,
1522 | createFormItemDriver,
1523 | createOptionDriver,
1524 | createTextBoxDriver,
1525 | }) => {
1526 | await initTestBed(`
1527 | <Form>
1528 | <FormItem testId="select" bindTo="authenticationType"
1529 | type="radioGroup" label="Authentication Type:" initialValue="{0}">
1530 | <Option value="{0}" label="Password" testId="password"/>
1531 | <Option value="{1}" label="Public Key" testId="publicKey" />
1532 | </FormItem>
1533 | <FormItem label="name1" testId="name1" bindTo="name1"
1534 | required="true" when="{$data.authenticationType == 0}"/>
1535 | <FormItem label="name2" testId="name2" bindTo="name2"
1536 | required="true" when="{$data.authenticationType == 1}"/>
1537 | </Form>
1538 | `);
1539 | const option1Driver = await createFormItemDriver("password");
1540 | const option2Driver = await createOptionDriver("publicKey");
1541 | const textfield1Element = (await createFormItemDriver("name1")).input;
1542 | const textfield1Driver = await createTextBoxDriver(textfield1Element);
1543 |
1544 | // Fill in first field
1545 | await textfield1Driver.field.fill("Test Value");
1546 | await expect(textfield1Driver.field).toHaveValue("Test Value");
1547 |
1548 | // Switch to second option
1549 | await option2Driver.component.click();
1550 |
1551 | // Switch back to first option
1552 | await option1Driver.component.click();
1553 |
1554 | // Field should retain its value
1555 | await expect(textfield1Driver.field).toHaveValue("Test Value");
1556 | });
1557 | });
1558 |
1559 | // =============================================================================
1560 | // ORIGINAL TEST SUITE (LEGACY TESTS)
1561 | // =============================================================================
1562 |
1563 | test("mock service responds", async ({ initTestBed, createFormDriver }) => {
1564 | await initTestBed(
1565 | `
1566 | <Form submitUrl="/test" />`,
1567 | {
1568 | apiInterceptor: {
1569 | operations: {
1570 | test: {
1571 | url: "/test",
1572 | method: "post",
1573 | handler: `return true;`,
1574 | },
1575 | },
1576 | },
1577 | },
1578 | );
1579 | const driver = await createFormDriver();
1580 | await driver.submitForm();
1581 |
1582 | const request = await driver.getSubmitResponse("/test");
1583 | expect(request.ok()).toEqual(true);
1584 | });
1585 |
1586 | // --- $data
1587 |
1588 | test("$data is correctly bound to form data", async ({ initTestBed, createButtonDriver }) => {
1589 | await initTestBed(`
1590 | <Form data="{{ field: 'test' }}">
1591 | <FormItem label="testField" bindTo="field">
1592 | <Button testId="custom" label="{$data.field}" />
1593 | </FormItem>
1594 | </Form> `);
1595 | const driver = await createButtonDriver("custom");
1596 | await expect(driver.component).toHaveExplicitLabel("test");
1597 | });
1598 |
1599 | test("$data is correctly undefined if data is not set in props", async ({
1600 | initTestBed,
1601 | createButtonDriver,
1602 | }) => {
1603 | await initTestBed(`
1604 | <Form>
1605 | <FormItem label="testField" bindTo="field">
1606 | <Button testId="custom" label="{$data.field}" />
1607 | </FormItem>
1608 | </Form> `);
1609 | const driver = await createButtonDriver("custom");
1610 | await expect(driver.component).toHaveExplicitLabel(undefined);
1611 | });
1612 |
1613 | test("Form buttons and contained FormItems are enabled", async ({
1614 | initTestBed,
1615 | page,
1616 | createFormDriver,
1617 | }) => {
1618 | await initTestBed(`
1619 | <Form testId="form">
1620 | <FormItem label="Name" bindTo="name" />
1621 | <FormItem label="Email" bindTo="email" />
1622 | </Form>
1623 | `);
1624 |
1625 | const driver = await createFormDriver("form");
1626 | await expect(page.getByText("Name")).toBeVisible();
1627 | await expect(page.getByText("Email")).toBeVisible();
1628 | await expect(driver.cancelButton).toBeEnabled();
1629 | await expect(driver.submitButton).toBeEnabled();
1630 | });
1631 |
1632 | test("submit only triggers when enabled", async ({ initTestBed, createFormDriver }) => {
1633 | const { testStateDriver } = await initTestBed(
1634 | `
1635 | <Form enabled="false" data="{{ name: 'John' }}" onSubmit="testState = true">
1636 | <FormItem bindTo="name" />
1637 | </Form>`,
1638 | );
1639 | const driver = await createFormDriver();
1640 | await expect(driver.submitButton).toBeDisabled();
1641 |
1642 | await driver.submitForm("keypress");
1643 | await expect.poll(testStateDriver.testState).toEqual(null);
1644 | });
1645 |
1646 | test("submit with unbound fields", async ({ page, initTestBed, createFormDriver }) => {
1647 | await initTestBed(`
1648 | <Fragment var.output="none">
1649 | <Form testId="form"
1650 | data="{{ firstname: 'James', lastname: 'Clewell' }}"
1651 | onSubmit="args => output = JSON.stringify(args)">
1652 | <FormItem label="Firstname" bindTo="firstname" />
1653 | <FormItem label="Middle name" initialValue="Robert" />
1654 | <FormItem label="Lastname" />
1655 | </Form>
1656 | <Text testId="text">{output}</Text>
1657 | </Fragment>
1658 | `);
1659 | const driver = await createFormDriver("form");
1660 | await driver.submitForm();
1661 | await expect(page.getByTestId("text")).toHaveText('{"firstname":"James"}');
1662 | });
1663 |
1664 | test(`submit with type 'items'`, async ({
1665 | initTestBed,
1666 | createFormDriver,
1667 | createButtonDriver,
1668 | createFormItemDriver,
1669 | }) => {
1670 | const { testStateDriver } = await initTestBed(`
1671 | <Form onSubmit="data => testState = data" testId="form">
1672 | <FormItem testId="formItem" type="items" bindTo="arrayItems" id="arrayItems">
1673 | <FormItem bindTo="name" testId="text{$itemIndex}"/>
1674 | </FormItem>
1675 | <Button testId="addButton" onClick="arrayItems.addItem()"/>
1676 | </Form>`);
1677 |
1678 | await (await createButtonDriver("addButton")).click();
1679 | await (await createFormItemDriver("text0")).textBox.fill("John");
1680 | await (await createButtonDriver("addButton")).click();
1681 | await (await createFormItemDriver("text1")).textBox.fill("Peter");
1682 | const driver = await createFormDriver("form");
1683 | await driver.submitForm();
1684 | await expect.poll(testStateDriver.testState).toStrictEqual({
1685 | arrayItems: [{ name: "John" }, { name: "Peter" }],
1686 | });
1687 | });
1688 |
1689 | test(`submit with type 'items', empty bindTo`, async ({
1690 | initTestBed,
1691 | createFormDriver,
1692 | createButtonDriver,
1693 | createFormItemDriver,
1694 | }) => {
1695 | const { testStateDriver } = await initTestBed(`
1696 | <Form onSubmit="data => testState = data" testId="form">
1697 | <FormItem testId="formItem" type="items" bindTo="arrayItems" id="arrayItems">
1698 | <FormItem testId="text{$itemIndex}" bindTo=""/>
1699 | </FormItem>
1700 | <Button testId="addButton" onClick="arrayItems.addItem()"/>
1701 | </Form>`);
1702 |
1703 | await (await createButtonDriver("addButton")).click();
1704 | await (await createFormItemDriver("text0")).textBox.fill("John");
1705 | await (await createButtonDriver("addButton")).click();
1706 | await (await createFormItemDriver("text1")).textBox.fill("Peter");
1707 | const driver = await createFormDriver("form");
1708 | await driver.submitForm();
1709 | await expect.poll(testStateDriver.testState).toStrictEqual({
1710 | arrayItems: ["John", "Peter"],
1711 | });
1712 | });
1713 |
1714 | // --- Testing
1715 |
1716 | // --- --- buttonRowTemplate
1717 |
1718 | test("buttonRowTemplate can render buttons", async ({ initTestBed, createButtonDriver }) => {
1719 | await initTestBed(`
1720 | <Form>
1721 | <property name="buttonRowTemplate">
1722 | <Button testId="submitBtn" type="submit" label="Hello Button" />
1723 | </property>
1724 | </Form>`);
1725 | await expect((await createButtonDriver("submitBtn")).component).toBeAttached();
1726 | });
1727 |
1728 | test("buttonRowTemplate replaces built-in buttons", async ({ initTestBed, createFormDriver }) => {
1729 | await initTestBed(`
1730 | <Form testId="form">
1731 | <property name="buttonRowTemplate">
1732 | <Button testId="submitBtn" type="submit" label="Hello Button" />
1733 | </property>
1734 | </Form>`);
1735 |
1736 | const driver = await createFormDriver("form");
1737 | await expect(driver.submitButton).not.toBeVisible();
1738 | await expect(driver.cancelButton).not.toBeVisible();
1739 | });
1740 |
1741 | test("setting buttonRowTemplate without buttons still runs submit on Enter", async ({
1742 | initTestBed,
1743 | createFormDriver,
1744 | }) => {
1745 | const { testStateDriver } = await initTestBed(`
1746 | <Form onSubmit="testState = true">
1747 | <property name="buttonRowTemplate">
1748 | <Fragment />
1749 | </property>
1750 | <FormItem bindTo="name" />
1751 | </Form>
1752 | `);
1753 | const driver = await createFormDriver();
1754 |
1755 | await driver.submitForm("keypress");
1756 | await expect.poll(testStateDriver.testState).toBe(true);
1757 | });
1758 |
1759 | test("data accepts an object", async ({
1760 | initTestBed,
1761 | createFormItemDriver,
1762 | createTextBoxDriver,
1763 | }) => {
1764 | await initTestBed(`
1765 | <Form data="{{ field1: 'test' }}">
1766 | <FormItem testId="inputField" bindTo="field1" />
1767 | </Form>
1768 | `);
1769 | const driver = await createFormItemDriver("inputField");
1770 | await expect((await createTextBoxDriver(driver.input)).field).toHaveValue("test");
1771 | });
1772 |
1773 | test(`data accepts primitive`, async ({ initTestBed, createFormDriver }) => {
1774 | await initTestBed(`
1775 | <Form data="test">
1776 | <FormItem bindTo="field1" />
1777 | </Form>
1778 | `);
1779 | const component = (await createFormDriver()).component;
1780 | await expect(component).toBeAttached();
1781 | });
1782 |
1783 | test(`data accepts empty array`, async ({ initTestBed, createFormDriver }) => {
1784 | await initTestBed(`
1785 | <Form data="{[]}">
1786 | <FormItem bindTo="field1" />
1787 | </Form>
1788 | `);
1789 | const component = (await createFormDriver()).component;
1790 | await expect(component).toBeAttached();
1791 | });
1792 |
1793 | test("data accepts relative URL endpoint", async ({
1794 | initTestBed,
1795 | createFormItemDriver,
1796 | createTextBoxDriver,
1797 | }) => {
1798 | await initTestBed(
1799 | `
1800 | <Form data="/test">
1801 | <FormItem testId="inputField" bindTo="name" />
1802 | </Form>`,
1803 | {
1804 | apiInterceptor: {
1805 | operations: {
1806 | test: {
1807 | url: "/test",
1808 | method: "get",
1809 | handler: `return { name: 'John' };`,
1810 | },
1811 | },
1812 | },
1813 | },
1814 | );
1815 | const driver = await createFormItemDriver("inputField");
1816 | await expect((await createTextBoxDriver(driver.input)).field).toHaveValue("John");
1817 | });
1818 |
1819 | test("cancel button and save button use default label", async ({
1820 | initTestBed,
1821 | createFormDriver,
1822 | }) => {
1823 | await initTestBed(`
1824 | <Form testId="form">
1825 | <FormItem label="Name" bindTo="name" />
1826 | <FormItem label="Email" bindTo="email" />
1827 | </Form>
1828 | `);
1829 |
1830 | const driver = await createFormDriver("form");
1831 | await expect(driver.cancelButton).toHaveText("Cancel");
1832 | await expect(driver.submitButton).toHaveText("Save");
1833 | });
1834 |
1835 | test("cancel button is rendered with cancelLabel", async ({ initTestBed, createFormDriver }) => {
1836 | await initTestBed(`
1837 | <Form testId="form" cancelLabel="Abort">
1838 | <FormItem label="Name" bindTo="name" />
1839 | <FormItem label="Email" bindTo="email" />
1840 | </Form>
1841 | `);
1842 |
1843 | const driver = await createFormDriver("form");
1844 | await expect(driver.cancelButton).toHaveText("Abort");
1845 | await expect(driver.submitButton).toHaveText("Save");
1846 | });
1847 |
1848 | test("save button is rendered with saveLabel", async ({ initTestBed, createFormDriver }) => {
1849 | await initTestBed(`
1850 | <Form testId="form" saveLabel="Submit">
1851 | <FormItem label="Name" bindTo="name" />
1852 | <FormItem label="Email" bindTo="email" />
1853 | </Form>
1854 | `);
1855 |
1856 | const driver = await createFormDriver("form");
1857 | await expect(driver.cancelButton).toHaveText("Cancel");
1858 | await expect(driver.submitButton).toHaveText("Submit");
1859 | });
1860 |
1861 | // swapCancelAndSave
1862 |
1863 | test("built-in button row order is default if swapCancelAndSave is false", async ({
1864 | initTestBed,
1865 | createFormDriver,
1866 | }) => {
1867 | await initTestBed(`
1868 | <Form testId="form" saveLabel="Submit">
1869 | <FormItem label="Name" bindTo="name" />
1870 | <FormItem label="Email" bindTo="email" />
1871 | </Form>
1872 | `);
1873 |
1874 | const driver = await createFormDriver("form");
1875 | const cancelBox = await driver.cancelButton.boundingBox();
1876 | const submitBox = await driver.submitButton.boundingBox();
1877 | expect(cancelBox.x).toBeLessThan(submitBox.x);
1878 | });
1879 |
1880 | test("built-in button row order flips if swapCancelAndSave is true", async ({
1881 | initTestBed,
1882 | createFormDriver,
1883 | }) => {
1884 | await initTestBed(`
1885 | <Form testId="form" saveLabel="Submit" swapCancelAndSave="true">
1886 | <FormItem label="Name" bindTo="name" />
1887 | <FormItem label="Email" bindTo="email" />
1888 | </Form>
1889 | `);
1890 |
1891 | const driver = await createFormDriver("form");
1892 | const cancelBox = await driver.cancelButton.boundingBox();
1893 | const submitBox = await driver.submitButton.boundingBox();
1894 | expect(cancelBox.x).toBeGreaterThan(submitBox.x);
1895 | });
1896 |
1897 | // --- submitUrl
1898 |
1899 | test("form submits to correct url", async ({ initTestBed, createFormDriver }) => {
1900 | const endpoint = "/test";
1901 | await initTestBed(
1902 | `
1903 | <Form data="{{ name: 'John' }}" submitUrl="${endpoint}" submitMethod="post">
1904 | <FormItem bindTo="name" />
1905 | </Form>`,
1906 | {
1907 | apiInterceptor: {
1908 | operations: {
1909 | test: {
1910 | url: endpoint,
1911 | method: "post",
1912 | handler: `{ return true; }`,
1913 | },
1914 | },
1915 | },
1916 | },
1917 | );
1918 | const driver = await createFormDriver();
1919 |
1920 | await driver.submitForm();
1921 | const response = await driver.getSubmitResponse(endpoint);
1922 | expect(response.ok()).toBe(true);
1923 | expect(new URL(response.url()).pathname).toBe(endpoint);
1924 | });
1925 |
1926 | // --- submitMethod
1927 |
1928 | // NOTE: GET doesn't work because GET/HEAD cannot have a 'body'
1929 | ["post", "put", "delete"].forEach((method) => {
1930 | test(`${method} REST op on submit`, async ({ initTestBed, createFormDriver }) => {
1931 | await initTestBed(`<Form submitUrl="/test" submitMethod="${method}" />`, {
1932 | apiInterceptor: {
1933 | operations: {
1934 | testPost: {
1935 | url: "/test",
1936 | method: "post",
1937 | handler: `return true;`,
1938 | },
1939 | testPut: {
1940 | url: "/test",
1941 | method: "put",
1942 | handler: `return true;`,
1943 | },
1944 | testDelete: {
1945 | url: "/test",
1946 | method: "delete",
1947 | handler: `return true;`,
1948 | },
1949 | },
1950 | },
1951 | });
1952 | const driver = await createFormDriver();
1953 | const request = await driver.getSubmitRequest("/test", method, "click");
1954 | expect(request.failure()).toBeNull();
1955 | });
1956 | });
1957 |
1958 | // --- submitting the Form
1959 |
1960 | test("submit triggers when clicking save/submit button", async ({
1961 | initTestBed,
1962 | createFormDriver,
1963 | }) => {
1964 | await initTestBed(
1965 | `
1966 | <Form data="{{ name: 'John' }}" submitUrl="/test" submitMethod="post">
1967 | <FormItem bindTo="name" />
1968 | </Form>`,
1969 | {
1970 | apiInterceptor: {
1971 | operations: {
1972 | test: {
1973 | url: "/test",
1974 | method: "post",
1975 | handler: `return true;`,
1976 | },
1977 | },
1978 | },
1979 | },
1980 | );
1981 | const driver = await createFormDriver();
1982 |
1983 | const request = await driver.getSubmitRequest("/test", "POST", "click");
1984 | expect(request.failure()).toBeNull();
1985 | });
1986 |
1987 | test("submit triggers when pressing Enter", async ({ initTestBed, createFormDriver }) => {
1988 | await initTestBed(
1989 | `
1990 | <Form data="{{ name: 'John' }}" submitUrl="/test" submitMethod="post">
1991 | <FormItem bindTo="name" />
1992 | </Form>`,
1993 | {
1994 | apiInterceptor: {
1995 | operations: {
1996 | test: {
1997 | url: "/test",
1998 | method: "post",
1999 | handler: `return true;`,
2000 | },
2001 | },
2002 | },
2003 | },
2004 | );
2005 | const driver = await createFormDriver();
2006 |
2007 | const request = await driver.getSubmitRequest("/test", "POST", "keypress");
2008 | expect(request.failure()).toBeNull();
2009 | });
2010 |
2011 | test("user cannot submit with clientside errors present", async ({
2012 | initTestBed,
2013 | createFormDriver,
2014 | }) => {
2015 | const { testStateDriver } = await initTestBed(`
2016 | <Form onSubmit="testState = true">
2017 | <FormItem bindTo="name" required="true" />
2018 | </Form>
2019 | `);
2020 | const driver = await createFormDriver();
2021 |
2022 | // The onSubmit event should have been triggered if not for the client error of an empty required field
2023 | await driver.submitForm("click");
2024 | await expect.poll(testStateDriver.testState).toEqual(null);
2025 | });
2026 |
2027 | // --- backend validation summary
2028 |
2029 | test("submitting with errors shows validation summary", async ({
2030 | initTestBed,
2031 | createFormDriver,
2032 | }) => {
2033 | await initTestBed(`<Form submitUrl="/general-validation-error" submitMethod="post" />`, {
2034 | apiInterceptor: errorDisplayInterceptor,
2035 | });
2036 | const driver = await createFormDriver();
2037 | await driver.submitForm();
2038 | await expect(await driver.getValidationSummary()).toBeVisible();
2039 | });
2040 |
2041 | test("submitting without errors does not show summary", async ({
2042 | initTestBed,
2043 | createFormDriver,
2044 | }) => {
2045 | await initTestBed(`<Form submitUrl="/no-validation-error" submitMethod="post" />`, {
2046 | apiInterceptor: errorDisplayInterceptor,
2047 | });
2048 | const driver = await createFormDriver();
2049 | await driver.submitForm();
2050 | await expect(await driver.getValidationSummary()).not.toBeVisible();
2051 | });
2052 |
2053 | test("general error messages are rendered in the summary", async ({
2054 | initTestBed,
2055 | createFormDriver,
2056 | createValidationDisplayDriver,
2057 | }) => {
2058 | await initTestBed(`<Form submitUrl="/general-validation-error" submitMethod="post" />`, {
2059 | apiInterceptor: errorDisplayInterceptor,
2060 | });
2061 | const formDriver = await createFormDriver();
2062 | await formDriver.submitForm();
2063 |
2064 | // TODO: strip this down -> it's verbose but hard to read
2065 | const warningDisplay = await createValidationDisplayDriver(
2066 | await formDriver.getValidationDisplaysBySeverity("warning"),
2067 | );
2068 | const errorDisplay = await createValidationDisplayDriver(
2069 | await formDriver.getValidationDisplaysBySeverity("error"),
2070 | );
2071 |
2072 | expect(await warningDisplay.getText()).toContain("Warning for the whole form");
2073 | expect(await errorDisplay.getText()).toContain("Error for the whole form");
2074 | });
2075 |
2076 | test("field-related errors are rendered at FormItems", async ({
2077 | initTestBed,
2078 | createFormDriver,
2079 | createFormItemDriver,
2080 | }) => {
2081 | await initTestBed(
2082 | `
2083 | <Form submitUrl="/field-validation-error" submitMethod="post">
2084 | <FormItem testId="testField" bindTo="test" label="test" />
2085 | </Form>`,
2086 | {
2087 | apiInterceptor: errorDisplayInterceptor,
2088 | },
2089 | );
2090 | const formDriver = await createFormDriver();
2091 | const fieldDriver = await createFormItemDriver("testField");
2092 |
2093 | await formDriver.submitForm();
2094 | await expect(fieldDriver.validationStatusIndicator).toHaveAttribute(
2095 | fieldDriver.validationStatusTag,
2096 | "warning",
2097 | );
2098 | });
2099 |
2100 | test("field-related errors map to correct FormItems", async ({
2101 | initTestBed,
2102 | createFormDriver,
2103 | createFormItemDriver,
2104 | }) => {
2105 | await initTestBed(
2106 | `
2107 | <Form submitUrl="/field-validation-error" submitMethod="post">
2108 | <FormItem testId="testField" bindTo="test" label="test" />
2109 | <FormItem testId="testField2" bindTo="test2" label="test2" />
2110 | </Form>`,
2111 | {
2112 | apiInterceptor: errorDisplayInterceptor,
2113 | },
2114 | );
2115 | const formDriver = await createFormDriver();
2116 | const fieldDriver = await createFormItemDriver("testField");
2117 |
2118 | await formDriver.submitForm();
2119 | await expect(fieldDriver.validationStatusIndicator).toHaveAttribute(
2120 | fieldDriver.validationStatusTag,
2121 | "warning",
2122 | );
2123 | });
2124 |
2125 | test.skip("field-related errors disappear if user updates FormItems", async ({
2126 | initTestBed,
2127 | page,
2128 | createFormItemDriver,
2129 | }) => {
2130 | await initTestBed(
2131 | `
2132 | <Form testId="form">
2133 | <FormItem testId="testField" bindTo="test" label="test" required />
2134 | <FormItem testId="testField2" bindTo="test2" label="test2" />
2135 | </Form>`,
2136 | );
2137 |
2138 | const fieldDriver = await createFormItemDriver("testField");
2139 | const fieldDriver2 = await createFormItemDriver("testField2");
2140 |
2141 | await fieldDriver.component.focus();
2142 | await fieldDriver.textBox.fill("a");
2143 | await fieldDriver.textBox.fill("");
2144 | await fieldDriver.textBox.blur();
2145 |
2146 | // Should show required error now
2147 | await expect(fieldDriver.textBox).toHaveValue("");
2148 | await expect(fieldDriver.validationStatusIndicator).toHaveAttribute(
2149 | fieldDriver.validationStatusTag,
2150 | "error",
2151 | );
2152 |
2153 | await fieldDriver.textBox.fill("a");
2154 | await fieldDriver.textBox.blur();
2155 |
2156 | await fieldDriver2.textBox.focus();
2157 |
2158 | await expect(fieldDriver2.textBox).toBeFocused();
2159 |
2160 | await fieldDriver2.textBox.fill("b");
2161 | await expect(fieldDriver.validationStatusIndicator).not.toBeVisible();
2162 | });
2163 |
2164 | const smartCrudInterceptor: ApiInterceptorDefinition = {
2165 | initialize: `
2166 | $state.items = {
2167 | [10]: { name: "Smith", id: 10 }
2168 | };
2169 | $state.currentId = 10;
2170 | `,
2171 | operations: {
2172 | create: {
2173 | url: "/entities",
2174 | method: "post",
2175 | handler: `() => {
2176 | $state.currentId++;
2177 | $state.items[$state.currentId] = $requestBody;
2178 | $state.items[$state.currentId].id = $state.currentId;
2179 |
2180 | return $state.items[$state.currentId];
2181 | }`,
2182 | },
2183 | read: {
2184 | url: "/entities/:id",
2185 | method: "get",
2186 | handler: `() => {
2187 | return $state.items[$pathParams.id];
2188 | }`,
2189 | },
2190 | update: {
2191 | url: "/entities/:id",
2192 | method: "put",
2193 | handler: `() => {
2194 | $state.items[$pathParams.id] = { ...$state.items[$pathParams.id], ...$requestBody };
2195 | return $state.items[$pathParams.id];
2196 | }`,
2197 | },
2198 | },
2199 | };
2200 |
2201 | test("create form works with submitUrl", async ({
2202 | initTestBed,
2203 | createFormDriver,
2204 | createFormItemDriver,
2205 | createTextBoxDriver,
2206 | }) => {
2207 | await initTestBed(
2208 | `
2209 | <Form submitUrl="/entities">
2210 | <FormItem bindTo="name" testId="nameInput"/>
2211 | </Form>
2212 | `,
2213 | { apiInterceptor: smartCrudInterceptor },
2214 | );
2215 | const formDriver = await createFormDriver();
2216 | const inputElement = (await createFormItemDriver("nameInput")).input;
2217 | const fieldDriver = await createTextBoxDriver(inputElement);
2218 |
2219 | await fieldDriver.field.fill("John");
2220 | await formDriver.submitForm("click");
2221 |
2222 | const response = await formDriver.getSubmitResponse();
2223 | expect(await response.json()).toEqual({
2224 | name: "John",
2225 | id: 11,
2226 | });
2227 | });
2228 |
2229 | test("regression: data url through modal context", async ({
2230 | initTestBed,
2231 | createButtonDriver,
2232 | createFormDriver,
2233 | createFormItemDriver,
2234 | createTextBoxDriver,
2235 | }) => {
2236 | await initTestBed(
2237 | `
2238 | <Fragment>
2239 | <Button testId="openModalButton" onClick="modal.open({data: '/entities/10'})"/>
2240 | <ModalDialog id="modal">
2241 | <Form testId="modalForm" data="{$param.data}" submitUrl="{$param.submitUrl}">
2242 | <FormItem bindTo="name" testId="nameInput"/>
2243 | </Form>
2244 | </ModalDialog>
2245 | </Fragment>
2246 | `,
2247 | {
2248 | apiInterceptor: smartCrudInterceptor,
2249 | },
2250 | );
2251 | const formDriver = await createFormDriver("modalForm");
2252 | const inputElement = (await createFormItemDriver("nameInput")).input;
2253 | const inputDriver = await createTextBoxDriver(inputElement);
2254 |
2255 | await (await createButtonDriver("openModalButton")).click();
2256 |
2257 | await expect(inputDriver.field).toHaveValue("Smith");
2258 |
2259 | await inputDriver.field.fill("EDITED-Smith");
2260 | await formDriver.submitForm("click");
2261 |
2262 | const response = await formDriver.getSubmitResponse();
2263 | expect(await response.json()).toEqual({
2264 | name: "EDITED-Smith",
2265 | id: 10,
2266 | });
2267 | });
2268 |
2269 | // --- Conditional Rendering Cases
2270 |
2271 | test("can submit with invisible required field", async ({
2272 | initTestBed,
2273 | createFormDriver,
2274 | createFormItemDriver,
2275 | createTextBoxDriver,
2276 | page,
2277 | }) => {
2278 | const { testStateDriver } = await initTestBed(`
2279 | <Form onSubmit="testState = true">
2280 | <FormItem testId="select" bindTo="authenticationType"
2281 | type="select" label="Authentication Type:" initialValue="{0}">
2282 | <Option value="{0}" label="Password" />
2283 | <Option value="{1}" label="Public Key" />
2284 | </FormItem>
2285 | <FormItem label="name1" testId="name1" bindTo="name1"
2286 | required="true" when="{$data.authenticationType == 0}"/>
2287 | <FormItem label="name2" testId="name2" bindTo="name2"
2288 | required="true" when="{$data.authenticationType == 1}"/>
2289 | </Form>
2290 | `);
2291 | const formDriver = await createFormDriver();
2292 | const selectDriver = await createFormItemDriver("select");
2293 | const textfieldElement = (await createFormItemDriver("name2")).input;
2294 | const textfieldDriver = await createTextBoxDriver(textfieldElement);
2295 |
2296 | await selectDriver.component.click();
2297 | await page.getByText("Public Key").click();
2298 | await textfieldDriver.field.fill("John");
2299 | await formDriver.submitForm();
2300 |
2301 | await expect.poll(testStateDriver.testState).toEqual(true);
2302 | });
2303 |
2304 | test("conditional fields keep the state", async ({
2305 | initTestBed,
2306 | createFormItemDriver,
2307 | createOptionDriver,
2308 | createTextBoxDriver,
2309 | }) => {
2310 | await initTestBed(`
2311 | <Form>
2312 | <FormItem testId="select" bindTo="authenticationType"
2313 | type="radioGroup" label="Authentication Type:" initialValue="{0}">
2314 | <Option value="{0}" label="Password" testId="password"/>
2315 | <Option value="{1}" label="Public Key" testId="publicKey" />
2316 | </FormItem>
2317 | <FormItem label="name1" testId="name1" bindTo="name1"
2318 | required="true" when="{$data.authenticationType == 0}"/>
2319 | <FormItem label="name2" testId="name2" bindTo="name2"
2320 | required="true" when="{$data.authenticationType == 1}"/>
2321 | </Form>
2322 | `);
2323 | const option1Driver = await createFormItemDriver("password");
2324 | const option2Driver = await createOptionDriver("publicKey");
2325 | const textfield1Element = (await createFormItemDriver("name1")).input;
2326 | const textfield1Driver = await createTextBoxDriver(textfield1Element);
2327 | const textfield2Element = (await createFormItemDriver("name2")).input;
2328 | const textfield2Driver = await createTextBoxDriver(textfield2Element);
2329 |
2330 | await textfield1Driver.field.fill("name1");
2331 | await option2Driver.click();
2332 | await textfield2Driver.field.fill("name2");
2333 | await option1Driver.click();
2334 |
2335 | await expect(textfield1Driver.field).toHaveValue("name1");
2336 | });
2337 |
```